diff options
author | Jeremias Maerki <jeremias@apache.org> | 2005-12-08 14:55:53 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2005-12-08 14:55:53 +0000 |
commit | 2f6fb03daf340a5a120dd9ed807f5ef3e04f8618 (patch) | |
tree | 8cf9937edf198a067b1e2e23ee60f3545e734a44 /src | |
parent | 26df5d3099cf61227665a120fd55c4d5461265c7 (diff) | |
download | xmlgraphics-fop-2f6fb03daf340a5a120dd9ed807f5ef3e04f8618.tar.gz xmlgraphics-fop-2f6fb03daf340a5a120dd9ed807f5ef3e04f8618.zip |
Bugfix: Areas for table-cells that are broken over more than one page are now generated even if all its content is already painted on a previous page. This fixes strange effects like a table grid that is not completely painted.
Some check in the test cases had to be adjusted because the indices weren't correct anymore, since now some previously missing areas are generated.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@355105 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 9fabeccc5..9b2d8e0f2 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -762,6 +762,7 @@ public class TableContentLayoutManager implements PercentBaseContext { public RowPainter(LayoutContext layoutContext) { this.layoutContext = layoutContext; Arrays.fill(firstRow, -1); + Arrays.fill(end, -1); } public int getAccumulatedBPD() { @@ -898,7 +899,8 @@ public class TableContentLayoutManager implements PercentBaseContext { GridUnit currentGU = lastRow.safelyGetGridUnit(i); if ((gridUnits[i] != null) && (forcedFlush || ((end[i] == gridUnits[i].getElements().size() - 1)) - && (currentGU == null || currentGU.isLastGridUnitRowSpan()))) { + && (currentGU == null || currentGU.isLastGridUnitRowSpan())) + || (gridUnits[i] == null && currentGU != null)) { //the last line in the "if" above is to avoid a premature end of an //row-spanned cell because no GridUnitParts are generated after a cell is //finished with its content. currentGU can be null if there's no grid unit @@ -907,13 +909,22 @@ public class TableContentLayoutManager implements PercentBaseContext { log.debug((forcedFlush ? "FORCED " : "") + "flushing..." + i + " " + start[i] + "-" + end[i]); } - addAreasForCell(gridUnits[i], start[i], end[i], - lastRow, - partLength[i], actualRowHeight); - gridUnits[i] = null; - start[i] = 0; - end[i] = 0; - partLength[i] = 0; + PrimaryGridUnit gu = gridUnits[i]; + if (gu == null + && !currentGU.isEmpty() + && currentGU.getColSpanIndex() == 0 + && currentGU.isLastGridUnitColSpan()) { + gu = currentGU.getPrimary(); + } + if (gu != null) { + addAreasForCell(gu, start[i], end[i], + lastRow, + partLength[i], actualRowHeight); + gridUnits[i] = null; + start[i] = 0; + end[i] = -1; + partLength[i] = 0; + } } } return actualRowHeight; @@ -950,8 +961,10 @@ public class TableContentLayoutManager implements PercentBaseContext { cellLM.setRowHeight(effCellHeight); //cellLM.setRowHeight(row.getHeight().opt); int prevBreak = ElementListUtils.determinePreviousBreak(pgu.getElements(), startPos); - SpaceResolver.performConditionalsNotification(pgu.getElements(), - startPos, endPos, prevBreak); + if (endPos >= 0) { + SpaceResolver.performConditionalsNotification(pgu.getElements(), + startPos, endPos, prevBreak); + } cellLM.addAreas(new KnuthPossPosIter(pgu.getElements(), startPos, endPos + 1), layoutContext); } |