You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ke...@apache.org on 2001/01/05 04:42:59 UTC

cvs commit: xml-fop/src/org/apache/fop/fo/flow Table.java

keiron      01/01/04 19:42:59

  Modified:    src/org/apache/fop/fo/flow Table.java
  Log:
  handles column heights properly, including if table goes over a page
  
  Revision  Changes    Path
  1.23      +20 -9     xml-fop/src/org/apache/fop/fo/flow/Table.java
  
  Index: Table.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/flow/Table.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Table.java	2000/12/21 05:20:28	1.22
  +++ Table.java	2001/01/05 03:42:59	1.23
  @@ -1,4 +1,4 @@
  -/*-- $Id: Table.java,v 1.22 2000/12/21 05:20:28 keiron Exp $ --
  +/*-- $Id: Table.java,v 1.23 2001/01/05 03:42:59 keiron Exp $ --
   
    ============================================================================
                      The Apache Software License, Version 1.1
  @@ -197,7 +197,7 @@
           boolean addedHeader = false;
           boolean addedFooter = false;
           int numChildren = this.children.size();
  -        for (int i = this.marker; i < numChildren; i++) {
  +        for (int i = 0; i < numChildren; i++) {
               FONode fo = (FONode) children.elementAt(i);
               if (fo instanceof TableColumn) {
                   TableColumn c = (TableColumn) fo;
  @@ -213,7 +213,11 @@
                   c.setColumnOffset(offset);
                   fo.layout(areaContainer);
                   offset += c.getColumnWidth();
  -            } else if (fo instanceof TableHeader) {
  +            }
  +        }
  +        for (int i = this.marker; i < numChildren; i++) {
  +            FONode fo = (FONode) children.elementAt(i);
  +            if (fo instanceof TableHeader) {
                   if (columns.size() == 0) {
                       MessageHandler.errorln("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
                       return new Status(Status.OK);
  @@ -281,6 +285,7 @@
                                 tableFooter.getYPosition() +
                                 ((TableBody) fo).getHeight());
                           }
  +                        setupColumnHeights();
                           status = new Status(Status.AREA_FULL_SOME);
                       }
                       return status;
  @@ -322,12 +327,7 @@
           if (height != 0)
               areaContainer.setHeight(height);
   
  -        for (int i = 0; i < numChildren; i++) {
  -            FONode fo = (FONode) children.elementAt(i);
  -            if (fo instanceof TableColumn) {
  -                ((TableColumn) fo).setHeight(areaContainer.getHeight());
  -            }
  -        }
  +        setupColumnHeights();
   
           areaContainer.end();
           area.addChild(areaContainer);
  @@ -361,6 +361,17 @@
           }
   
           return new Status(Status.OK);
  +    }
  +
  +    protected void setupColumnHeights()
  +    {
  +        int numChildren = this.children.size();
  +        for (int i = 0; i < numChildren; i++) {
  +            FONode fo = (FONode) children.elementAt(i);
  +            if (fo instanceof TableColumn) {
  +                ((TableColumn) fo).setHeight(areaContainer.getHeight());
  +            }
  +        }
       }
   
       public int getAreaHeight() {