jeremias    2005/02/11 02:45:24

  Modified:    src/java/org/apache/fop/layoutmgr/table
                        TableLayoutManager.java
               src/java/org/apache/fop/fo/flow Table.java
  Log:
  Implemented table-omit-header-at-break. The same for footers comes later when 
page breaking is revisited.
  
  Revision  Changes    Path
  1.18      +11 -5     
xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
  
  Index: TableLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- TableLayoutManager.java   10 Feb 2005 19:40:46 -0000      1.17
  +++ TableLayoutManager.java   11 Feb 2005 10:45:24 -0000      1.18
  @@ -57,6 +57,7 @@
       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 @@
                   //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 @@
                       stackSize.add(bp.getStackingSize());
                       lastPos = bp;
                       bodyBreaks.add(bp);
  +                    firstRowHandled = true;
   
                       if (bp.nextBreakOverflows()) {
                           over = true;
  
  
  
  1.48      +10 -0     xml-fop/src/java/org/apache/fop/fo/flow/Table.java
  
  Index: Table.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Table.java,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- Table.java        9 Feb 2005 15:38:15 -0000       1.47
  +++ Table.java        11 Feb 2005 10:45:24 -0000      1.48
  @@ -179,6 +179,16 @@
       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.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to