From 943be3b89f4b5638a5251fd69f846837d2ffff55 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Wed, 6 Apr 2005 08:36:51 +0000 Subject: [PATCH] Fixed setting the BPD on the block area for the table (fixes table background and cursor advancement in renderers). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198566 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/table/TableContentLayoutManager.java | 9 ++++++++- .../apache/fop/layoutmgr/table/TableLayoutManager.java | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java index 35223d36f..ec0e149bf 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java @@ -52,6 +52,7 @@ public class TableContentLayoutManager { private TableLayoutManager tableLM; private TableRowIterator trIter; + private int usedBPD; public TableContentLayoutManager(TableLayoutManager parent) { this.tableLM = parent; @@ -311,6 +312,7 @@ public class TableContentLayoutManager { } public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { + this.usedBPD = 0; int colCount = getColumns().getColumnCount(); TableRowIterator.EffRow lastRow = null; int lastRowHeight = 0; @@ -333,6 +335,7 @@ public class TableContentLayoutManager { if (lastRow != tcpos.row && lastRow != null) { //yoffset += lastRow.getHeight().opt; yoffset += lastRowHeight; + this.usedBPD += lastRowHeight; } lastRow = tcpos.row; Iterator iter = tcpos.gridUnitParts.iterator(); @@ -397,7 +400,7 @@ public class TableContentLayoutManager { layoutContext, lastRow, yoffset, partLength[i], maxLen); } } - + this.usedBPD += lastRowHeight; //for last row } private int getExplicitCellHeight(PrimaryGridUnit pgu) { @@ -427,6 +430,10 @@ public class TableContentLayoutManager { start, end + 1), layoutContext); } + public int getUsedBPD() { + return this.usedBPD; + } + private class GridUnitPart { protected PrimaryGridUnit pgu; diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 0a6d0c19e..ffd1973bc 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -672,6 +672,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager } contentLM.addAreas(parentIter, layoutContext); + tableHeight += contentLM.getUsedBPD(); // add footer areas if (footerBreak != null) { -- 2.39.5