aboutsummaryrefslogtreecommitdiffstats
path: root/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
diff options
context:
space:
mode:
authorSayi <sayi@apache.org>2021-03-20 16:21:41 +0000
committerSayi <sayi@apache.org>2021-03-20 16:21:41 +0000
commit0efa53456a11291cc4bdd1d93f135bb065db61cd (patch)
tree4fba57857c43070fd68bb4960c11592b8ad866d1 /src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
parent6167f3416fefc30997e1c8742d04ae83dbb09338 (diff)
downloadpoi-0efa53456a11291cc4bdd1d93f135bb065db61cd.tar.gz
poi-0efa53456a11291cc4bdd1d93f135bb065db61cd.zip
Create, get, modify and remove comments, support operating paragraphs, pictures and tables in comments
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1887867 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java')
-rw-r--r--src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
index 06df99be12..ee741bace4 100644
--- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
+++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFRun.java
@@ -1082,6 +1082,10 @@ public class XWPFRun implements ISDTContents, IRunElement, CharacterRun {
XWPFHeaderFooter headerFooter = (XWPFHeaderFooter) parent.getPart();
relationId = headerFooter.addPictureData(pictureData, pictureType);
picData = (XWPFPictureData) headerFooter.getRelationById(relationId);
+ } else if (parent.getPart() instanceof XWPFComments) {
+ XWPFComments comments = (XWPFComments) parent.getPart();
+ relationId = comments.addPictureData(pictureData, pictureType);
+ picData = (XWPFPictureData) comments.getRelationById(relationId);
} else {
@SuppressWarnings("resource")
XWPFDocument doc = parent.getDocument();