From: Vincent Hennebert Date: Thu, 26 Apr 2007 14:20:04 +0000 (+0000) Subject: Make keep-with-next and keep-with-previous work on fo:table X-Git-Tag: fop-0_94~120 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=975a67c11687c31f0fa075afbb9aea00a63d0e58;p=xmlgraphics-fop.git Make keep-with-next and keep-with-previous work on fo:table git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@532754 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java index 00ecb01d2..2d305d5fa 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java @@ -323,6 +323,12 @@ public class TableLayoutManager extends BlockStackingLayoutManager } addKnuthElementsForSpaceAfter(returnList, alignment); addKnuthElementsForBreakAfter(returnList, context); + if (mustKeepWithNext()) { + context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING); + } + if (mustKeepWithPrevious()) { + context.setFlags(LayoutContext.KEEP_WITH_PREVIOUS_PENDING); + } setFinished(true); resetSpaces(); return returnList; diff --git a/test/layoutengine/standard-testcases/table_keep-with-next.xml b/test/layoutengine/standard-testcases/table_keep-with-next.xml new file mode 100644 index 000000000..08b32325d --- /dev/null +++ b/test/layoutengine/standard-testcases/table_keep-with-next.xml @@ -0,0 +1,75 @@ + + + + + +

+ This test checks that keep-with-next works on tables. +

+
+ + + + + + + + + + First line + + + + + + Cell 1.1 Line 1 + Cell 1.1 Line 2 + + + Cell 1.2 Line 1 + Cell 1.2 Line 2 + + + + + Cell 2.1 Line 1 + Cell 2.1 Line 2 + + + Cell 2.1 Line 1 + Cell 2.1 Line 2 + + + + + After the table + + + + + + + + + + + + +
diff --git a/test/layoutengine/standard-testcases/table_keep-with-previous.xml b/test/layoutengine/standard-testcases/table_keep-with-previous.xml new file mode 100644 index 000000000..e62f50280 --- /dev/null +++ b/test/layoutengine/standard-testcases/table_keep-with-previous.xml @@ -0,0 +1,75 @@ + + + + + +

+ This test checks that keep-with-previous works on tables. +

+
+ + + + + + + + + + First line + Before the table + + + + + + Cell 1.1 Line 1 + Cell 1.1 Line 2 + + + Cell 1.2 Line 1 + Cell 1.2 Line 2 + + + + + Cell 2.1 Line 1 + Cell 2.1 Line 2 + + + Cell 2.1 Line 1 + Cell 2.1 Line 2 + + + + + + + + + + + + + + + + +