]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Implemented table-omit-header-at-break. The same for footers comes later when page...
authorJeremias Maerki <jeremias@apache.org>
Fri, 11 Feb 2005 10:45:24 +0000 (10:45 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 11 Feb 2005 10:45:24 +0000 (10:45 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198418 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/fo/flow/Table.java
src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java

index d82a146317c474d3a666f095ab38531613186d8f..15b402fa6466f8991e1866cf580b0a33797e105f 100644 (file)
@@ -179,6 +179,16 @@ public class Table extends FObj {
     public TableBody getTableFooter() {
         return tableFooter;
     }
+    
+    /** @return true if the table-header should be omitted at breaks */
+    public boolean omitHeaderAtBreak() {
+        return (this.tableOmitHeaderAtBreak == EN_TRUE);
+    }
+
+    /** @return true if the table-footer should be omitted at breaks */
+    public boolean omitFooterAtBreak() {
+        return (this.tableOmitFooterAtBreak == EN_TRUE);
+    }
 
     /**
      * @return the "inline-progression-dimension" property.
index 0a2a767dec4d7ed1fce62d1a1d28907d47587aea..c2778fce78a57b081d94b9e6f262d77bb6f0d2b2 100644 (file)
@@ -57,6 +57,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
     private List bodyBreaks = new java.util.ArrayList();
     private BreakPoss headerBreak;
     private BreakPoss footerBreak;
+    private boolean firstRowHandled = false;
     
     private int referenceIPD;
     private boolean autoLayout = true;
@@ -185,13 +186,17 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
                 //Calculate the headers and footers only when needed
                 MinOptMax headerSize = null;
                 if (getTable().getTableHeader() != null) {
-                    Body tableHeader = new Body(getTable().getTableHeader());
-                    tableHeader.setParent(this);
-                    headerBreak = getHeight(tableHeader, context);
-                    headerSize = headerBreak.getStackingSize();
-                    stackSize.add(headerSize);
+                    if (!getTable().omitHeaderAtBreak() || !firstRowHandled) {
+                        Body tableHeader = new Body(getTable().getTableHeader());
+                        tableHeader.setParent(this);
+                        headerBreak = getHeight(tableHeader, context);
+                        headerSize = headerBreak.getStackingSize();
+                        stackSize.add(headerSize);
+                    }
                 }
 
+                //TODO Implement table-omit-footer-at-break once the page breaking
+                //is improved, so we don't have to do this twice
                 MinOptMax footerSize = null;
                 if (getTable().getTableFooter() != null) {
                     Body tableFooter = new Body(getTable().getTableFooter());
@@ -244,6 +249,7 @@ public class TableLayoutManager extends BlockStackingLayoutManager {
                     stackSize.add(bp.getStackingSize());
                     lastPos = bp;
                     bodyBreaks.add(bp);
+                    firstRowHandled = true;
 
                     if (bp.nextBreakOverflows()) {
                         over = true;