aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-05-01 11:19:36 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-05-01 11:19:36 +0000
commit65cc46dec3ade80e28405bc81a6219f095fb7143 (patch)
treed590a1b216d9ffde6de82530282040954d25d650 /src/java
parent88f28b18dc043093b0d97183b43ba24b2f370b20 (diff)
downloadxmlgraphics-fop-65cc46dec3ade80e28405bc81a6219f095fb7143.tar.gz
xmlgraphics-fop-65cc46dec3ade80e28405bc81a6219f095fb7143.zip
Changes from revision 768320 introduced another bug: footnotes from later steps were taken into account too early
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@770635 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/layoutmgr/table/ActiveCell.java32
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();
}
}