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 {
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;
<changes>
<release version="FOP Trunk">
+ <action context="Layout" dev="JM" type="fix" fixes-bug="44160">
+ Fixed a possible IndexOutOfBoundsException that could happen with certain constellations
+ when footnotes are used.
+ </action>
<action context="Layout" dev="JM" type="fix">
Compliance fix: for absolutely positioned block-containers, "top" wasn't
interpreted correctly.