From 90c4f67b1d76f2702a4d21eb3eb1e0ee0eb1ff6b Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Thu, 11 Jan 2001 05:00:25 +0000 Subject: [PATCH] handles orphans properly 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 | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/org/apache/fop/fo/flow/TableBody.java b/src/org/apache/fop/fo/flow/TableBody.java index da393004d..87c317ad4 100644 --- a/src/org/apache/fop/fo/flow/TableBody.java +++ b/src/org/apache/fop/fo/flow/TableBody.java @@ -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) { -- 2.39.5