]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Partial fix for Bugzilla 45702: instead of wrapping the forcedBreakAfterLast element...
authorAndreas L. Delmelle <adelmelle@apache.org>
Sat, 30 Aug 2008 16:37:53 +0000 (16:37 +0000)
committerAndreas L. Delmelle <adelmelle@apache.org>
Sat, 30 Aug 2008 16:37:53 +0000 (16:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@690532 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
test/layoutengine/standard-testcases/page-number-citation-last_break-after_bug45702.xml [new file with mode: 0644]

index 8837b1a0f595f18dafaeeeb5eceb5d9bb30236ce..64b8bbc0d33c9f850e83c3bd045b338710975380 100644 (file)
@@ -406,7 +406,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
 
         if (forcedBreakAfterLast != null) {
             forcedBreakAfterLast.clearPendingMarks();
-            wrapPositionElement(forcedBreakAfterLast, returnList, false);
+            returnList.add(forcedBreakAfterLast);
         }
 
         context.updateKeepWithNextPending(getKeepWithNextStrength());
@@ -1043,7 +1043,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
         }
         return breakBefore;
     }
-    
+
     /**
      * Creates Knuth elements for break-after and adds them to the return list.
      * @param returnList return list to add the additional elements to
diff --git a/test/layoutengine/standard-testcases/page-number-citation-last_break-after_bug45702.xml b/test/layoutengine/standard-testcases/page-number-citation-last_break-after_bug45702.xml
new file mode 100644 (file)
index 0000000..1ca74f4
--- /dev/null
@@ -0,0 +1,76 @@
+<?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 for correct resolution of page-number-citation-last, in\r
+      case a break-after is set on the last child block to the block carrying the id.\r
+      (see also Bugzilla #45702)\r
+    </p>\r
+  </info>\r
+  <fo>\r
+  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">\r
+    <fo:layout-master-set>\r
+      <fo:simple-page-master master-name="A4" page-height="29.7cm" page-width="21cm" margin="2cm">\r
+        <fo:region-body margin-top="0cm" region-name="xsl-region-body"/>\r
+      </fo:simple-page-master>\r
+    </fo:layout-master-set>\r
+    <fo:page-sequence master-reference="A4" id="toc">\r
+      <fo:flow flow-name="xsl-region-body">\r
+        <fo:block>\r
+          PS : from <fo:page-number-citation id="pnc.page-sequence" ref-id="page-sequence"/> to <fo:page-number-citation-last id="pncl.page-sequence" ref-id="page-sequence"/> \r
+        </fo:block>\r
+        <fo:block>\r
+          toc : from <fo:page-number-citation id="pnc.toc" ref-id="toc"/> to <fo:page-number-citation-last id="pncl.toc" ref-id="toc"/> \r
+        </fo:block>\r
+        <fo:block>\r
+          block-1 : from <fo:page-number-citation id="pnc.block-1" ref-id="block-1"/> to <fo:page-number-citation-last id="pncl.block-1" ref-id="block-1"/> \r
+        </fo:block>\r
+      </fo:flow>\r
+    </fo:page-sequence>\r
+    <fo:page-sequence master-reference="A4" id="page-sequence">\r
+      <fo:flow flow-name="xsl-region-body">\r
+        <fo:block id="block-1">\r
+          <fo:block padding="1pt">two blocks, with break-after specified on the last one</fo:block>\r
+            <fo:block break-before="page">XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX </fo:block>\r
+            <fo:block break-before="page" break-after="page">XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX \r
+            XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX </fo:block>\r
+        </fo:block>\r
+      </fo:flow>\r
+    </fo:page-sequence>\r
+  </fo:root>\r
+  </fo>\r
+  <checks>\r
+    <eval expected="1" xpath="/areaTree/pageSequence[1]//text[@prod-id='pnc.toc']/word" />\r
+    <eval expected="1" xpath="/areaTree/pageSequence[1]//text[@prod-id='pncl.toc']/word" />\r
+    <eval expected="2" xpath="/areaTree/pageSequence[1]//text[@prod-id='pnc.page-sequence']/word" />\r
+    <eval expected="4" xpath="/areaTree/pageSequence[1]//text[@prod-id='pncl.page-sequence']/word" />\r
+    <eval expected="2" xpath="/areaTree/pageSequence[1]//text[@prod-id='pnc.block-1']/word" />\r
+    <eval expected="4" xpath="/areaTree/pageSequence[1]//text[@prod-id='pncl.block-1']/word" />\r
+  </checks>\r
+</testcase>\r