]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
makes sure that the header and footer are removed if no body fits
authorKeiron Liddle <keiron@apache.org>
Wed, 13 Dec 2000 03:53:23 +0000 (03:53 +0000)
committerKeiron Liddle <keiron@apache.org>
Wed, 13 Dec 2000 03:53:23 +0000 (03:53 +0000)
on a page

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193869 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/flow/Table.java
src/org/apache/fop/fo/flow/TableBody.java
src/org/apache/fop/fo/flow/TableFooter.java
src/org/apache/fop/layout/AreaContainer.java

index 659adc177b83f7e2260b9357c72acbc4d6626ac7..daffbe5a3314723b464d787ae90d2f836747527e 100644 (file)
@@ -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();
index d4854e7c58b4e5c5e5e5696a203dc73a826cd521..befcb02ef440bcc723b027c546265fce2b3392b3 100644 (file)
@@ -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();
+    }
 }
index 7fa15b77a934264b595571c968623607ec39078f..818e208ae19f84f3b0f6074dbb1f307f199fa2c4 100644 (file)
@@ -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)
index 2f994f32e834c6615513a9d0de69021854581514..e97129bd2efc7c215cad354e250346ec96c65c2a 100644 (file)
@@ -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;
     }