diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-12-15 16:59:37 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-12-15 16:59:37 +0000 |
commit | d324cc1917bd595f9e5fb9ef7e14c94fd5db27d1 (patch) | |
tree | 0417f968ccadbec4ebecec571361a62e6357685e /src | |
parent | 24f34a7b1b01c68868353e82a00c4fafa1697b12 (diff) | |
download | xmlgraphics-fop-d324cc1917bd595f9e5fb9ef7e14c94fd5db27d1.tar.gz xmlgraphics-fop-d324cc1917bd595f9e5fb9ef7e14c94fd5db27d1.zip |
Bugzilla #37875:
Some content inside a table-header may not have been renderered on pages n > 1 in certain conditions.
LineLM kept state between calls to addAreas which can have ugly side-effects in case of table-headers, for example, where the same positions are rendered more than once. I don't know why the bug only manifests if there's an overflow in the second line of the table-header in the test case.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@357045 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 3eea3b6af..4eaf30088 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -100,6 +100,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager */ private static class LineBreakPosition extends LeafPosition { private int iParIndex; // index of the Paragraph this Position refers to + private int iStartIndex; //index of the first element this Position refers to private int availableShrink; private int availableStretch; private int difference; @@ -112,7 +113,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager private int spaceAfter; private int baseline; - LineBreakPosition(LayoutManager lm, int index, int iBreakIndex, + LineBreakPosition(LayoutManager lm, int index, int iStartIndex, int iBreakIndex, int shrink, int stretch, int diff, double ipdA, double adjust, int ind, int lh, int lw, int sb, int sa, int bl) { @@ -121,6 +122,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager availableStretch = stretch; difference = diff; iParIndex = index; + this.iStartIndex = iStartIndex; ipdAdjust = ipdA; dAdjust = adjust; startIndent = ind; @@ -139,7 +141,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager private int effectiveAlignment; private Length textIndent; private Length lastLineEndIndent; - private int iIndents = 0; private CommonHyphenation hyphenationProperties; private Numeric hyphenationLadderCount; private int wrapOption = EN_WRAP; @@ -152,8 +153,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager private List knuthParagraphs = null; private int iReturnedLBP = 0; - private int iStartElement = 0; - private int iEndElement = 0; // parameters of Knuth's algorithm: // penalty value for flagged penalties @@ -531,13 +530,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager if (bZeroHeightLine) { return new LineBreakPosition(thisLLM, knuthParagraphs.indexOf(par), - lastElementIndex, + firstElementIndex, lastElementIndex, availableShrink, availableStretch, difference, ratio, 0, indent, 0, iLineWidth, 0, 0, 0); } else { return new LineBreakPosition(thisLLM, knuthParagraphs.indexOf(par), - lastElementIndex, + firstElementIndex, lastElementIndex, availableShrink, availableStretch, difference, ratio, 0, indent, lineLead + lineFollow, iLineWidth, spaceBefore, spaceAfter, @@ -1038,7 +1037,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager } } LineBreakPosition lbp = new LineBreakPosition(this, - knuthParagraphs.indexOf(seq), seq.size() - 1, + knuthParagraphs.indexOf(seq), 0, seq.size() - 1, lineShrink, lineStretch, 0, 0, 0, 0, lineHeight, iLineWidth, 0, 0, 0); lineLayouts.addBreakPosition(lbp, 0); @@ -1694,8 +1693,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager LineBreakPosition lbp = (LineBreakPosition) pos; iCurrParIndex = lbp.iParIndex; - KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(iCurrParIndex); - iEndElement = lbp.getLeafPos(); + KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(iCurrParIndex); + int iStartElement = lbp.iStartIndex; + int iEndElement = lbp.getLeafPos(); LineArea lineArea = new LineArea((lbp.getLeafPos() < seq.size() - 1 ? textAlignment : textAlignmentLast), lbp.difference, lbp.availableStretch, lbp.availableShrink); |