diff options
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java index 0eae922479..65c726d102 100644 --- a/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java +++ b/src/ooxml/java/org/apache/poi/xwpf/usermodel/XWPFParagraph.java @@ -142,13 +142,21 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para iruns.add(r); } if (o instanceof CTHyperlink) { - CTHyperlink link = (CTHyperlink) o; + CTHyperlink link = (CTHyperlink)o; for (CTR r : link.getRArray()) { XWPFHyperlinkRun hr = new XWPFHyperlinkRun(link, r, this); runs.add(hr); iruns.add(hr); } } + if (o instanceof CTSimpleField) { + CTSimpleField field = (CTSimpleField)o; + for (CTR r : field.getRArray()) { + XWPFFieldRun fr = new XWPFFieldRun(field, r, this); + runs.add(fr); + iruns.add(fr); + } + } if (o instanceof CTSdtBlock) { XWPFSDT cc = new XWPFSDT((CTSdtBlock) o, part); iruns.add(cc); @@ -164,13 +172,6 @@ public class XWPFParagraph implements IBodyElement, IRunBody, ISDTContents, Para iruns.add(cr); } } - if (o instanceof CTSimpleField) { - for (CTR r : ((CTSimpleField) o).getRArray()) { - XWPFRun cr = new XWPFRun(r, this); - runs.add(cr); - iruns.add(cr); - } - } if (o instanceof CTSmartTagRun) { // Smart Tags can be nested many times. // This implementation does not preserve the tagging information |