]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed setting the BPD on the block area for the table (fixes table background and...
authorJeremias Maerki <jeremias@apache.org>
Wed, 6 Apr 2005 08:36:51 +0000 (08:36 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 6 Apr 2005 08:36:51 +0000 (08:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198566 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java

index 35223d36f0436ebbf31d6f28ac0f90b01eaa0935..ec0e149bf99538046ca6aaedfe7842c8ebe2a9a3 100644 (file)
@@ -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;
index 0a6d0c19ebe7b39efc663fe8f28cd13af53aac5e..ffd1973bc895914b0022e8d8fa784dd6efbff0fd 100644 (file)
@@ -672,6 +672,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager
         }
 
         contentLM.addAreas(parentIter, layoutContext);
+        tableHeight += contentLM.getUsedBPD();
 
         // add footer areas
         if (footerBreak != null) {