]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
this handles the situation where the first row of a table
authorKeiron Liddle <keiron@apache.org>
Tue, 28 Nov 2000 07:09:29 +0000 (07:09 +0000)
committerKeiron Liddle <keiron@apache.org>
Tue, 28 Nov 2000 07:09:29 +0000 (07:09 +0000)
cannot fit on the current page, so the table must begin from
the next page.
This makes sure that no part of the table remains on the page
and also no border will show up

Code changes sponsored by Dresdner Bank, Germany

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193843 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/TableRow.java
src/org/apache/fop/layout/Area.java

index 89595d02f3d84c4832e9bf27b443b67c275fc17f..03272fcecc1190d50aeb4bd784f37806f4590677 100644 (file)
@@ -218,9 +218,11 @@ public class Table extends FObj {
                        status = new Status(Status.AREA_FULL_SOME);
                    }
                    //areaContainer.end();
-                   area.addChild(areaContainer);
-                   area.increaseHeight(areaContainer.getHeight());
-                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight()); 
+               if(!(/*(i == 0) && */(areaContainer.getContentHeight() <= 0))) {
+                   area.addChild(areaContainer);
+                       area.increaseHeight(areaContainer.getHeight());
+                    area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
+            }
                    return status;
                }
            }
index d5139c94830eb8f6ba81833601f059c3b4d4d600..c7b04986f5af23e9ab3b5e6bdefd98df3fe5aaf9 100644 (file)
@@ -164,11 +164,13 @@ public class TableBody extends FObj {
                if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
                    status = new Status(Status.AREA_FULL_SOME);
                }
+               if(!((i == 0) && (areaContainer.getContentHeight() <= 0))) {
                area.addChild(areaContainer);
                //areaContainer.end();
 
-               area.increaseHeight(areaContainer.getHeight());
+                       area.increaseHeight(areaContainer.getHeight());
                 area.setAbsoluteHeight(areaContainer.getAbsoluteHeight());
+            }
                return status;
            }
        }
index af4d03176cb63bef7b1a24d8d44e360a9c331e42..28c02f242672e8086dd2a9ab71abc3418e8cbc54 100644 (file)
@@ -104,6 +104,7 @@ public class TableRow extends FObj {
     Vector columns;
 
     AreaContainer areaContainer;
+    DisplaySpace spacer = null;
 
     public TableRow(FObj parent, PropertyList propertyList) {
        super(parent, propertyList);
@@ -211,7 +212,8 @@ public class TableRow extends FObj {
        }
 
        if ((spaceBefore != 0) && (this.marker ==0)) {
-           area.addDisplaySpace(spaceBefore);
+           spacer = new DisplaySpace(spaceBefore);
+           area.increaseHeight(spaceBefore);
        }
 
         if ( marker==0 ) {
@@ -267,6 +269,8 @@ public class TableRow extends FObj {
                    status = new Status(Status.AREA_FULL_SOME);
                }
                
+               if(spacer != null)
+                       area.removeChild(spacer);
                area.removeChild(areaContainer);
                 this.resetMarker();                
                 this.removeID(area.getIDReferences());
@@ -284,6 +288,8 @@ public class TableRow extends FObj {
             cell.setHeight(largestCellHeight);
        }
 
+    if(spacer != null)
+        area.addChild(spacer);
        area.addChild(areaContainer);
        areaContainer.end();
         area.addDisplaySpace(largestCellHeight
index bed0a247eb2e38b70c83f28da5daa45b8d723b80..2ecee588ea2776ee5ecc16c7d428e05462917000 100644 (file)
@@ -226,6 +226,12 @@ abstract public class Area extends Box {
        this.children.removeElement(area);
     }
        
+    public void removeChild(DisplaySpace spacer) {
+       this.currentHeight -= spacer.getSize();
+        this.absoluteHeight -= spacer.getSize();
+       this.children.removeElement(spacer);
+    }
+
     public void remove() {
        this.parent.removeChild(this);
     }