diff options
author | Yegor Kozlov <yegor@apache.org> | 2011-11-19 12:28:33 +0000 |
---|---|---|
committer | Yegor Kozlov <yegor@apache.org> | 2011-11-19 12:28:33 +0000 |
commit | ef049ea258d029ea6730dfcea032993bdfe8aa65 (patch) | |
tree | 5de3697e4ff847cf951fbabdc025a1158e3cd7a5 /src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java | |
parent | e7ba4f6f8c790a319144092f2d2d8a3623f43dd6 (diff) | |
download | poi-ef049ea258d029ea6730dfcea032993bdfe8aa65.tar.gz poi-ef049ea258d029ea6730dfcea032993bdfe8aa65.zip |
Bugzilla 52209: fixed inserting multiple pictures to a group or slide in XSLF
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1203969 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java')
-rw-r--r-- | src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java index a0a5c73fda..dcca92fbf9 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFTextParagraph.java @@ -841,18 +841,22 @@ public class XSLFTextParagraph implements Iterable<XSLFTextRun>{ layout = measurer.nextLayout((float)wrappingWidth, nextBreak, false);
}
- int endIndex = measurer.getPosition();
-
- TextAlign hAlign = getTextAlign();
- if(hAlign == TextAlign.JUSTIFY || hAlign == TextAlign.JUSTIFY_LOW) {
- layout = layout.getJustifiedLayout((float)wrappingWidth);
+ if(layout == null) {
+ // exit if can't break any more
+ break;
}
+ int endIndex = measurer.getPosition();
// skip over new line breaks (we paint 'clear' text runs not starting or ending with \n)
if(endIndex < it.getEndIndex() && text.charAt(endIndex) == '\n'){
measurer.setPosition(endIndex + 1);
}
+ TextAlign hAlign = getTextAlign();
+ if(hAlign == TextAlign.JUSTIFY || hAlign == TextAlign.JUSTIFY_LOW) {
+ layout = layout.getJustifiedLayout((float)wrappingWidth);
+ }
+
AttributedString str = new AttributedString(it, startIndex, endIndex);
TextFragment line = new TextFragment(
layout, // we will not paint empty paragraphs
|