diff options
author | Keiron Liddle <keiron@apache.org> | 2000-12-13 03:53:23 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2000-12-13 03:53:23 +0000 |
commit | 9f32257ad872af34623768576a21bfd6c5b53f0c (patch) | |
tree | 8c8b0d2e0b05b3e9d0ba91c1e2a73f66de6e5b0e | |
parent | 49b6731e47a1534f9cef1b409b7533404cf61a96 (diff) | |
download | xmlgraphics-fop-9f32257ad872af34623768576a21bfd6c5b53f0c.tar.gz xmlgraphics-fop-9f32257ad872af34623768576a21bfd6c5b53f0c.zip |
makes sure that the header and footer are removed if no body fits
on a page
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193869 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/org/apache/fop/fo/flow/Table.java | 4 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/TableBody.java | 10 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/TableFooter.java | 2 | ||||
-rw-r--r-- | src/org/apache/fop/layout/AreaContainer.java | 4 |
4 files changed, 17 insertions, 3 deletions
diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java index 659adc177..daffbe5a3 100644 --- a/src/org/apache/fop/fo/flow/Table.java +++ b/src/org/apache/fop/fo/flow/Table.java @@ -244,6 +244,10 @@ public class Table extends FObj { if ((status = fo.layout(areaContainer)).isIncomplete()) { this.marker = i; if (/*(i != 0) && */(status.getCode() == Status.AREA_FULL_NONE)) { + if(tableHeader != null) + tableHeader.removeLayout(areaContainer); + if(tableFooter != null) + tableFooter.removeLayout(areaContainer); // status = new Status(Status.AREA_FULL_SOME); } //areaContainer.end(); diff --git a/src/org/apache/fop/fo/flow/TableBody.java b/src/org/apache/fop/fo/flow/TableBody.java index d4854e7c5..befcb02ef 100644 --- a/src/org/apache/fop/fo/flow/TableBody.java +++ b/src/org/apache/fop/fo/flow/TableBody.java @@ -104,12 +104,12 @@ public class TableBody extends FObj { public int getYPosition() { - return areaContainer.getYPosition(); + return areaContainer.getCurrentYPosition(); } public int getHeight() { - return areaContainer.getHeight(); + return areaContainer.getHeight() + spaceBefore + spaceAfter; } public Status layout(Area area) throws FOPException { @@ -270,4 +270,10 @@ public class TableBody extends FObj { public int getAreaHeight() { return areaContainer.getHeight(); } + + public void removeLayout(Area area) + { + area.removeChild(areaContainer); + this.resetMarker(); + } } diff --git a/src/org/apache/fop/fo/flow/TableFooter.java b/src/org/apache/fop/fo/flow/TableFooter.java index 7fa15b77a..818e208ae 100644 --- a/src/org/apache/fop/fo/flow/TableFooter.java +++ b/src/org/apache/fop/fo/flow/TableFooter.java @@ -73,7 +73,7 @@ public class TableFooter extends TableBody { public int getYPosition() { - return areaContainer.getYPosition() - spaceBefore; + return areaContainer.getCurrentYPosition() - spaceBefore; } public void setYPosition(int value) diff --git a/src/org/apache/fop/layout/AreaContainer.java b/src/org/apache/fop/layout/AreaContainer.java index 2f994f32e..e97129bd2 100644 --- a/src/org/apache/fop/layout/AreaContainer.java +++ b/src/org/apache/fop/layout/AreaContainer.java @@ -93,6 +93,10 @@ public class AreaContainer extends Area { return yPosition + this.paddingTop + this.borderWidthTop; } + public int getCurrentYPosition() { + return yPosition; + } + public void setYPosition(int value) { yPosition = value; } |