Author: vhennebert
Date: Mon Mar 21 16:46:53 2011
New Revision: 1083863

URL: http://svn.apache.org/viewvc?rev=1083863&view=rev
Log:
Bugfix: keep-together on a table containing row-spanning cells was not honored

Added:
    
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
   (with props)
Modified:
    
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
    xmlgraphics/fop/trunk/status.xml

Modified: 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java?rev=1083863&r1=1083862&r2=1083863&view=diff
==============================================================================
--- 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java 
(original)
+++ 
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/table/TableStepper.java 
Mon Mar 21 16:46:53 2011
@@ -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());

Modified: xmlgraphics/fop/trunk/status.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/status.xml?rev=1083863&r1=1083862&r2=1083863&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/status.xml (original)
+++ xmlgraphics/fop/trunk/status.xml Mon Mar 21 16:46:53 2011
@@ -59,6 +59,9 @@
       documents. Example: the fix of marks layering will be such a case when 
it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Layout" dev="VH" type="fix">
+        Bugfix: keep-together on a table containing row-spanning cells was not 
honored.
+      </action>
       <action context="Layout" dev="VH" type="fix" fixes-bug="50196" 
due-to="Matthias Reischenbacher">
         Bugzilla #50196: padding-start ignored when table-header/footer is 
repeated.
       </action>

Added: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml?rev=1083863&view=auto
==============================================================================
--- 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
 (added)
+++ 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
 Mon Mar 21 16:46:53 2011
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<testcase>
+  <info>
+    <p>
+      This test checks that keep-together works on tables that have a cell 
spanning several rows.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"; 
xmlns:svg="http://www.w3.org/2000/svg";>
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="page"
+          page-height="320pt" page-width="420pt" margin="10pt">
+          <fo:region-body background-color="#F0F0F0"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="page">
+        <fo:flow flow-name="xsl-region-body" font-size="8pt" 
line-height="10pt">
+          <fo:block>Block</fo:block>
+          <fo:block space-before="245pt">Before the table</fo:block>
+          <fo:table table-layout="fixed" width="100%" id="table" 
keep-together.within-page="always">
+            <fo:table-body>
+              <fo:table-row>
+                <fo:table-cell id="Cell 1.1" border="1pt solid black" 
number-rows-spanned="2">
+                  <fo:block>Cell 1.1</fo:block>
+                </fo:table-cell>
+                <fo:table-cell id="Cell 1.2" border="1pt solid black">
+                  <fo:block>Cell 1.2</fo:block>
+                  <fo:block>Cell 1.2</fo:block>
+                  <fo:block>Cell 1.2</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+              <fo:table-row>
+                <fo:table-cell id="Cell 2.2" border="1pt solid black">
+                  <fo:block>Cell 2.2</fo:block>
+                  <fo:block>Cell 2.2</fo:block>
+                  <fo:block>Cell 2.2</fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="0"     
xpath="count(//pageViewport[1]//block[@prod-id='table'])"/>
+    <eval expected="62000" 
xpath="//pageViewport[2]//block[@prod-id='table']/@bpd"/>
+    <eval expected="61000" xpath="//pageViewport[2]//block[@prod-id='Cell 
1.1']/@bpd"/>
+    <eval expected="30000" xpath="//pageViewport[2]//block[@prod-id='Cell 
1.2']/@bpd"/>
+    <eval expected="30000" xpath="//pageViewport[2]//block[@prod-id='Cell 
2.2']/@bpd"/>
+  </checks>
+</testcase>

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
xmlgraphics/fop/trunk/test/layoutengine/standard-testcases/table_keep-together_row-span.xml
------------------------------------------------------------------------------
    svn:keywords = Revision Id



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to