From 1337f45867b9e8e97da1b4672260b674721a172c Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Mon, 21 Mar 2011 16:46:53 +0000 Subject: [PATCH] Bugfix: keep-together on a table containing row-spanning cells was not honored git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1083863 13f79535-47bb-0310-9956-ffa450edef68 --- .../fop/layoutmgr/table/TableStepper.java | 4 +- status.xml | 3 + .../table_keep-together_row-span.xml | 69 +++++++++++++++++++ 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 test/layoutengine/standard-testcases/table_keep-together_row-span.xml diff --git a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java index 92e8ba5dd..7e37eeb59 100644 --- a/src/java/org/apache/fop/layoutmgr/table/TableStepper.java +++ b/src/java/org/apache/fop/layoutmgr/table/TableStepper.java @@ -239,7 +239,7 @@ public class TableStepper { } } - Keep keep = Keep.KEEP_AUTO; + Keep keep = getTableLM().getKeepTogether(); int stepPenalty = 0; for (Iterator iter = activeCells.iterator(); iter.hasNext();) { ActiveCell activeCell = (ActiveCell) iter.next(); @@ -248,8 +248,6 @@ public class TableStepper { } if (!rowFinished) { keep = keep.compare(rowGroup[activeRowIndex].getKeepTogether()); - //The above call doesn't take the penalty from the table into account, so... - keep = keep.compare(getTableLM().getKeepTogether()); } else if (activeRowIndex < rowGroup.length - 1) { keep = keep.compare(rowGroup[activeRowIndex].getKeepWithNext()); keep = keep.compare(rowGroup[activeRowIndex + 1].getKeepWithPrevious()); diff --git a/status.xml b/status.xml index 73e6f6c0d..337164b31 100644 --- a/status.xml +++ b/status.xml @@ -59,6 +59,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Bugfix: keep-together on a table containing row-spanning cells was not honored. + Bugzilla #50196: padding-start ignored when table-header/footer is repeated. diff --git a/test/layoutengine/standard-testcases/table_keep-together_row-span.xml b/test/layoutengine/standard-testcases/table_keep-together_row-span.xml new file mode 100644 index 000000000..b751fcaee --- /dev/null +++ b/test/layoutengine/standard-testcases/table_keep-together_row-span.xml @@ -0,0 +1,69 @@ + + + + + +

+ This test checks that keep-together works on tables that have a cell spanning several rows. +

+
+ + + + + + + + + + Block + Before the table + + + + + Cell 1.1 + + + Cell 1.2 + Cell 1.2 + Cell 1.2 + + + + + Cell 2.2 + Cell 2.2 + Cell 2.2 + + + + + + + + + + + + + + + +
-- 2.39.5