diff options
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr/table/ActiveCell.java')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/table/ActiveCell.java | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java index ffbb1ff03..30177f988 100644 --- a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java +++ b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java @@ -20,6 +20,7 @@ package org.apache.fop.layoutmgr.table; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.ListIterator; @@ -78,14 +79,6 @@ class ActiveCell { private int spanIndex = 0; - /** - * The list of active footnotes. Those are the footnotes from the next step - * that is due to be merged by TableStepper. - * - * @see {@link #addFootnotes(List)} - */ - private List footnotes; - private Step previousStep; private Step nextStep; /** @@ -111,6 +104,8 @@ class ActiveCell { private int penaltyLength; /** Value of the penalty ending this step, 0 if the step does not end on a penalty. */ private int penaltyValue; + /** List of footnotes for this step. */ + private List footnoteList; /** * One of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, @@ -140,6 +135,12 @@ class ActiveCell { this.totalLength = other.totalLength; this.penaltyLength = other.penaltyLength; this.penaltyValue = other.penaltyValue; + if (other.footnoteList != null) { + if (this.footnoteList == null) { + this.footnoteList = new ArrayList(); + } + this.footnoteList.addAll(other.footnoteList); + } this.condBeforeContentLength = other.condBeforeContentLength; this.breakClass = other.breakClass; } @@ -303,6 +304,9 @@ class ActiveCell { afterNextStep.penaltyValue = 0; afterNextStep.condBeforeContentLength = 0; afterNextStep.breakClass = Constants.EN_AUTO; + if (afterNextStep.footnoteList != null) { + afterNextStep.footnoteList.clear(); + } boolean breakFound = false; boolean prevIsBox = false; boolean boxFound = false; @@ -333,10 +337,10 @@ class ActiveCell { prevIsBox = false; } else { if (el instanceof KnuthBlockBox && ((KnuthBlockBox) el).hasAnchors()) { - if (footnotes == null) { - footnotes = new ArrayList(); + if (afterNextStep.footnoteList == null) { + afterNextStep.footnoteList = new LinkedList(); } - footnotes.addAll(((KnuthBlockBox) el).getFootnoteBodyLMs()); + afterNextStep.footnoteList.addAll(((KnuthBlockBox) el).getFootnoteBodyLMs()); } prevIsBox = true; boxFound = true; @@ -566,9 +570,9 @@ class ActiveCell { * @param footnoteList the list to which this cell must add its footnotes */ void addFootnotes(List footnoteList) { - if (includedInLastStep() && footnotes != null) { - footnoteList.addAll(footnotes); - footnotes.clear(); + if (includedInLastStep() && nextStep.footnoteList != null) { + footnoteList.addAll(nextStep.footnoteList); + nextStep.footnoteList.clear(); } } |