Fixed Off-by-one-Error which skipped paragraph styles

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713546 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andreas Beeker 2015-11-09 21:37:10 +00:00
parent ce66e14b5a
commit b0b4c020ed

View File

@ -1272,7 +1272,7 @@ public final class HSLFTextParagraph implements TextParagraph<HSLFShape,HSLFText
int paraIdx = 0;
for (TextPropCollection p : paraStyles) {
for (int ccPara = 0, ccStyle = p.getCharactersCovered(); ccPara < ccStyle; paraIdx++) {
if (paraIdx >= paragraphs.size() || ccPara >= ccStyle-1) return;
if (paraIdx >= paragraphs.size()) return;
HSLFTextParagraph htp = paragraphs.get(paraIdx);
TextPropCollection pCopy = new TextPropCollection(0, TextPropType.paragraph);
pCopy.copy(p);