diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2013-01-29 20:15:21 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2013-01-29 20:15:21 +0000 |
commit | 4680aede4413ce5b1b50bc84daaa3b5b8ecd816a (patch) | |
tree | 356220a988cd917054361ecd124a4d2b0d0d38f5 /src | |
parent | 5c06a584d6d7400ee5972d9e1538aa7f80d2c728 (diff) | |
download | xmlgraphics-fop-4680aede4413ce5b1b50bc84daaa3b5b8ecd816a.tar.gz xmlgraphics-fop-4680aede4413ce5b1b50bc84daaa3b5b8ecd816a.zip |
JIRA-1719 Fix IIOBE thrown when the final footnote-only page starts on a new footnote
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1440094 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 4fa138da5..dce290b50 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -885,19 +885,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { // create pages containing the remaining footnote bodies while (insertedFootnotesLength < totalFootnotesLength) { - final int tmpLength = lengthList.get(footnoteListIndex); - // check if last footnote has already been added completely - if (insertedFootnotesLength == tmpLength) { - footnoteListIndex++; - footnoteElementIndex - = getFootnoteList(footnoteListIndex).size() - 1; - } else if ((tmpLength - insertedFootnotesLength) <= availableBPD) { - // try adding some more content - // add a whole footnote - availableBPD -= tmpLength - insertedFootnotesLength; - insertedFootnotesLength = tmpLength; - footnoteElementIndex - = getFootnoteList(footnoteListIndex).size() - 1; + if (totalFootnotesLength - insertedFootnotesLength <= availableBPD) { + // All the remaining footnotes fit + insertedFootnotesLength = totalFootnotesLength; + footnoteListIndex = lengthList.size() - 1; + footnoteElementIndex = getFootnoteList(footnoteListIndex).size() - 1; } else if ((split = getFootnoteSplit // CSOK: InnerAssignment (footnoteListIndex, footnoteElementIndex, insertedFootnotesLength, availableBPD, true)) > 0) { |