diff options
author | Keiron Liddle <keiron@apache.org> | 2001-01-05 03:42:59 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2001-01-05 03:42:59 +0000 |
commit | ed9052ff8f76ccabc6586f84b16b7b41f8c1cc55 (patch) | |
tree | 03c3c7046b20af30461665238c72bcfef1df5e5d | |
parent | 60c95207b16b4a06f8f25c07cb40b199523436c1 (diff) | |
download | xmlgraphics-fop-ed9052ff8f76ccabc6586f84b16b7b41f8c1cc55.tar.gz xmlgraphics-fop-ed9052ff8f76ccabc6586f84b16b7b41f8c1cc55.zip |
handles column heights properly, including if table goes over a page
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193952 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/fo/flow/Table.java | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java index b393341dd..9a3393529 100644 --- a/src/org/apache/fop/fo/flow/Table.java +++ b/src/org/apache/fop/fo/flow/Table.java @@ -197,7 +197,7 @@ public class Table extends FObj { 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 @@ public class Table extends FObj { 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 @@ public class Table extends FObj { tableFooter.getYPosition() + ((TableBody) fo).getHeight()); } + setupColumnHeights(); status = new Status(Status.AREA_FULL_SOME); } return status; @@ -322,12 +327,7 @@ public class Table extends FObj { 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); @@ -363,6 +363,17 @@ public class Table extends FObj { 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() { return areaContainer.getHeight(); } |