diff options
author | Keiron Liddle <keiron@apache.org> | 2000-12-21 05:20:28 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2000-12-21 05:20:28 +0000 |
commit | 7091cac7c30ea4b92927295538e3c0df5286f3c5 (patch) | |
tree | b3c279ee31470c92dcfaa23bda20fbadf495f000 /src | |
parent | 714eb76a9ac812a9ef303b4b81792b214906f42f (diff) | |
download | xmlgraphics-fop-7091cac7c30ea4b92927295538e3c0df5286f3c5.tar.gz xmlgraphics-fop-7091cac7c30ea4b92927295538e3c0df5286f3c5.zip |
fixed a couple of bugs with footers, multiple table bodies
and removing incompletely laid out rows
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193917 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/fo/flow/Table.java | 11 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/TableRow.java | 14 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java index 72d0c4aae..b393341dd 100644 --- a/src/org/apache/fop/fo/flow/Table.java +++ b/src/org/apache/fop/fo/flow/Table.java @@ -94,6 +94,7 @@ public class Table extends FObj { Vector columns = new Vector(); int currentColumnNumber = 0; + int bodyCount = 0; AreaContainer areaContainer; @@ -194,6 +195,7 @@ public class Table extends FObj { int offset = 0; boolean addedHeader = false; + boolean addedFooter = false; int numChildren = this.children.size(); for (int i = this.marker; i < numChildren; i++) { FONode fo = (FONode) children.elementAt(i); @@ -239,11 +241,12 @@ public class Table extends FObj { addedHeader = true; tableHeader.resetMarker(); } - if (tableFooter != null && !this.omitFooterAtBreak) { + if (tableFooter != null && !this.omitFooterAtBreak && !addedFooter) { if ((status = tableFooter.layout(areaContainer)). isIncomplete()) { return new Status(Status.AREA_FULL_NONE); } + addedFooter = true; tableFooter.resetMarker(); } fo.setWidows(widows); @@ -252,11 +255,12 @@ public class Table extends FObj { if ((status = fo.layout(areaContainer)).isIncomplete()) { this.marker = i; - if (status.getCode() == Status.AREA_FULL_NONE) { + if (bodyCount == 0 && status.getCode() == Status.AREA_FULL_NONE) { if (tableHeader != null) tableHeader.removeLayout(areaContainer); if (tableFooter != null) tableFooter.removeLayout(areaContainer); + resetMarker(); // status = new Status(Status.AREA_FULL_SOME); } //areaContainer.end(); @@ -277,8 +281,11 @@ public class Table extends FObj { tableFooter.getYPosition() + ((TableBody) fo).getHeight()); } + status = new Status(Status.AREA_FULL_SOME); } return status; + } else { + bodyCount++; } if (tableFooter != null && !this.omitFooterAtBreak) { // move footer to bottom of area and move up body diff --git a/src/org/apache/fop/fo/flow/TableRow.java b/src/org/apache/fop/fo/flow/TableRow.java index 5f4012432..a7e7f571d 100644 --- a/src/org/apache/fop/fo/flow/TableRow.java +++ b/src/org/apache/fop/fo/flow/TableRow.java @@ -113,6 +113,7 @@ public class TableRow extends FObj { DisplaySpace spacer = null; boolean hasAddedSpacer = false; DisplaySpace spacerAfter = null; + boolean areaAdded = false; /** * The list of cell states for this row. This is the location of @@ -482,11 +483,14 @@ public class TableRow extends FObj { } } else { // added on 11/28/2000, by Dresdner Bank, Germany - if (hasAddedSpacer && spacer != null) + if (spacer != null) { area.removeChild(spacer); + spacer = null; + } hasAddedSpacer = false; if(spacerAfter != null) area.removeChild(spacerAfter); + spacerAfter = null; // removing something that was added by succession // of cell.layout() @@ -524,6 +528,7 @@ public class TableRow extends FObj { } area.addChild(areaContainer); + areaAdded = true; areaContainer.end(); area.addDisplaySpace(largestCellHeight + areaContainer.getPaddingTop() + @@ -548,8 +553,8 @@ public class TableRow extends FObj { if (!someCellDidNotLayoutCompletely && spaceAfter != 0) { spacerAfter = new DisplaySpace(spaceAfter); - area.increaseHeight(spaceAfter); area.addChild(spacerAfter); + area.increaseHeight(spaceAfter); } if (area instanceof BlockArea) { @@ -582,11 +587,12 @@ public class TableRow extends FObj { area.increaseHeight(-spaceBefore); } } - hasAddedSpacer = false; if(spacerAfter != null) area.removeChild(spacerAfter); //area.increaseHeight(areaContainer.getHeight()); - area.removeChild(areaContainer); + if(areaAdded) + area.removeChild(areaContainer); + areaAdded = false; this.resetMarker(); cells = null; this.removeID(area.getIDReferences()); |