]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
handles orphans properly
authorKeiron Liddle <keiron@apache.org>
Thu, 11 Jan 2001 05:00:25 +0000 (05:00 +0000)
committerKeiron Liddle <keiron@apache.org>
Thu, 11 Jan 2001 05:00:25 +0000 (05:00 +0000)
fixed a keep problem

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

src/org/apache/fop/fo/flow/TableBody.java

index da393004d8916c13442a6cb0a7ccc8a932749ff6..87c317ad45366cc4949c137d168c62cf13d203b4 100644 (file)
@@ -192,9 +192,8 @@ public class TableBody extends FObj {
             if (row.getKeepWithPrevious().getType() != KeepValue.KEEP_WITH_AUTO && lastRow != null &&
                     keepWith.indexOf(lastRow) == -1) {
                 keepWith.addElement(lastRow);
-                endKeepGroup = false;
             } else {
-                if(endKeepGroup) {
+                if(endKeepGroup && keepWith.size() > 0) {
                     keepWith = new Vector();
                 }
             }
@@ -227,9 +226,9 @@ public class TableBody extends FObj {
                     resetMarker();
                     return new Status(Status.AREA_FULL_NONE);
                 }
-                if (numChildren - i < orphans && numChildren > orphans) {
-                    for (int count = numChildren - orphans - i;
-                            count > 0; count--) {
+                if (numChildren - i < orphans && numChildren >= orphans) {
+                    for (int count = i;
+                            count > numChildren - orphans - 1; count--) {
                         row = (TableRow) children.elementAt(count);
                         row.removeLayout(areaContainer);
                         i--;
@@ -261,9 +260,7 @@ public class TableBody extends FObj {
                 keepWith.addElement(row);
                 endKeepGroup = false;
             } else {
-                if (keepWith.size() > 0 && row.getKeepWithPrevious().getType() == KeepValue.KEEP_WITH_AUTO) {
-                    endKeepGroup = true;
-                }
+                endKeepGroup = true;
             }
             lastRow = row;
         }
@@ -286,10 +283,6 @@ public class TableBody extends FObj {
         return new Status(Status.OK);
     }
 
-/*    public int getAreaHeight() {
-        return areaContainer.getHeight();
-    }*/
-
     public void removeLayout(Area area) {
         area.removeChild(areaContainer);
         if (spaceBefore != 0) {