From afd0547e64416e0e830c4c7b3ec65baa1fae560b Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Wed, 10 Jan 2001 00:18:43 +0000 Subject: [PATCH] fixes a keep-with-previous problem git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193959 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/flow/TableBody.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/org/apache/fop/fo/flow/TableBody.java b/src/org/apache/fop/fo/flow/TableBody.java index 46a340e30..da393004d 100644 --- a/src/org/apache/fop/fo/flow/TableBody.java +++ b/src/org/apache/fop/fo/flow/TableBody.java @@ -183,6 +183,7 @@ public class TableBody extends FObj { Vector keepWith = new Vector(); int numChildren = this.children.size(); TableRow lastRow = null; + boolean endKeepGroup = true; for (int i = this.marker; i < numChildren; i++) { TableRow row = (TableRow) children.elementAt(i); @@ -191,6 +192,11 @@ 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) { + keepWith = new Vector(); + } } Status status; @@ -253,9 +259,10 @@ public class TableBody extends FObj { return status; } else if (status.getCode() == Status.KEEP_WITH_NEXT) { keepWith.addElement(row); + endKeepGroup = false; } else { if (keepWith.size() > 0 && row.getKeepWithPrevious().getType() == KeepValue.KEEP_WITH_AUTO) { - keepWith = new Vector(); + endKeepGroup = true; } } lastRow = row; -- 2.39.5