diff options
author | Jeremias Maerki <jeremias@apache.org> | 2008-01-22 14:02:27 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2008-01-22 14:02:27 +0000 |
commit | 449a0d0764f7269b5924f7b7822b67409386cdda (patch) | |
tree | c76a207f73af8a6be4e2dbba0883accb602120cb /src | |
parent | f92cc1b2d3e144dd33efe2f4925d543c9ccaa3f6 (diff) | |
download | xmlgraphics-fop-449a0d0764f7269b5924f7b7822b67409386cdda.tar.gz xmlgraphics-fop-449a0d0764f7269b5924f7b7822b67409386cdda.zip |
Bugzilla #44160:
Fixed a possible IndexOutOfBoundsException that could happen with certain constellations when footnotes are used. Note: I haven't been able to come up with a scaled-down testcase for regression testing. Maybe someone more intimate with the footnote handling can.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@614201 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index a9ef9fd13..32c2b8d3b 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -25,11 +25,11 @@ import java.util.ListIterator; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; import org.apache.fop.layoutmgr.AbstractBreaker.PageBreakPosition; - import org.apache.fop.traits.MinOptMax; class PageBreakingAlgorithm extends BreakingAlgorithm { @@ -641,10 +641,14 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { demerits += (footnotesList.size() - 1 - footnoteListIndex) * deferredFootnoteDemerits; } - if (footnoteElementIndex - < ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1) { - // add demerits for the footnote split between pages - demerits += splitFootnoteDemerits; + if (footnoteListIndex < footnotesList.size()) { + if (footnoteElementIndex + < ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1) { + // add demerits for the footnote split between pages + demerits += splitFootnoteDemerits; + } + } else { + //TODO Why can this happen in the first place? Does anybody know? See #44160 } } demerits += activeNode.totalDemerits; |