]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugfix for keep-with-next inside tables:
authorJeremias Maerki <jeremias@apache.org>
Sun, 1 Apr 2007 10:02:43 +0000 (10:02 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sun, 1 Apr 2007 10:02:43 +0000 (10:02 +0000)
Once a keep-with-next was set inside a table, the FO following the table would always be glued to the previous table.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@524571 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/table/TableContentLayoutManager.java
status.xml
test/layoutengine/standard-testcases/table-row_keep-with-next2.xml [new file with mode: 0644]

index 44a13af8b7fc400693e883325cc22aa9bae1ea0a..c3e1a41da27e64cfcea2f1a955ec274fa0bb23cc 100644 (file)
@@ -235,6 +235,12 @@ public class TableContentLayoutManager implements PercentBaseContext {
             if (!isSeparateBorderModel()) {
                 resolveNormalBeforeAfterBordersForRowGroup(rowGroup, iter);
             }
+
+            //Reset keep-with-next when remaining inside the table.
+            //The context flag is only used to propagate keep-with-next to the outside.
+            //The clearing is ok here because createElementsForRowGroup already handles
+            //the keep when inside a table.
+            context.setFlags(LayoutContext.KEEP_WITH_NEXT_PENDING, false);
             
             //Element list creation
             createElementsForRowGroup(context, alignment, bodyType, 
index 4772cb821f60346bee557b0b2c2bd903711e74c5..105fe986d138b7386e06dd37a6e53eb22133151a 100644 (file)
 
   <changes>
     <release version="FOP Trunk">
+      <action context="Code" dev="JM" type="fix">
+        Fixed a problem with keep-with-next on table-rows. Once a keep-with-next was set
+        inside a table, the FO following the table would always be glued to the previous table.
+      </action>
       <action context="Code" dev="JM" type="fix">
         Fixed a problem with the auto-rotate-landscape setting in the PostScript renderer.
         It didn't generate the right setpagedevice command.
diff --git a/test/layoutengine/standard-testcases/table-row_keep-with-next2.xml b/test/layoutengine/standard-testcases/table-row_keep-with-next2.xml
new file mode 100644 (file)
index 0000000..55086e5
--- /dev/null
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--\r
+  Licensed to the Apache Software Foundation (ASF) under one or more\r
+  contributor license agreements.  See the NOTICE file distributed with\r
+  this work for additional information regarding copyright ownership.\r
+  The ASF licenses this file to You under the Apache License, Version 2.0\r
+  (the "License"); you may not use this file except in compliance with\r
+  the License.  You may obtain a copy of the License at\r
+  \r
+  http://www.apache.org/licenses/LICENSE-2.0\r
+  \r
+  Unless required by applicable law or agreed to in writing, software\r
+  distributed under the License is distributed on an "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+  See the License for the specific language governing permissions and\r
+  limitations under the License.\r
+-->\r
+<!-- $Id$ -->\r
+<testcase>\r
+  <info>\r
+    <p>\r
+      This test checks keep-with-next behaviour on a table-row.\r
+    </p>\r
+    <p>
+      There used to be a bug where the keep-with-next signal wouldn't get cleared and\r
+      resulted in too little break possibilities.
+    </p>\r
+  </info>\r
+  <fo>\r
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" widows="0" orphans="0">\r
+      <fo:layout-master-set>\r
+        <fo:simple-page-master master-name="normal" page-width="5in" page-height="4.5 * 14.4pt">\r
+          <fo:region-body/>\r
+        </fo:simple-page-master>\r
+      </fo:layout-master-set>\r
+      <fo:page-sequence master-reference="normal">\r
+        <fo:flow flow-name="xsl-region-body">\r
+          <fo:table table-layout="fixed" width="100%" id="A">\r
+            <fo:table-column column-width="proportional-column-width(1)"/>\r
+            <fo:table-body>\r
+              <fo:table-row keep-with-next="always">\r
+                <fo:table-cell id="cellA1">\r
+                  <fo:block>line1</fo:block>\r
+                </fo:table-cell>\r
+              </fo:table-row>\r
+              <fo:table-row keep-together="always">\r
+                <fo:table-cell id="cellA2">\r
+                  <fo:block>line1</fo:block>\r
+                  <fo:block>line2</fo:block>\r
+                </fo:table-cell>\r
+              </fo:table-row>\r
+            </fo:table-body>\r
+          </fo:table>\r
+          <fo:block>block</fo:block>\r
+        </fo:flow>\r
+      </fo:page-sequence>\r
+    </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <element-list category="breaker">\r
+      <box w="14400"/>\r
+      <penalty w="0" p="INF"/>\r
+      <box w="28800"/>\r
+      <penalty w="0" p="0"/>\r
+      <box w="14400"/>\r
+      <skip>3</skip>\r
+    </element-list>\r
+  </checks>\r
+</testcase>\r