]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
JIRA-1719 Fix IIOBE thrown when the final footnote-only page starts on a new footnote
authorVincent Hennebert <vhennebert@apache.org>
Tue, 29 Jan 2013 20:15:21 +0000 (20:15 +0000)
committerVincent Hennebert <vhennebert@apache.org>
Tue, 29 Jan 2013 20:15:21 +0000 (20:15 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1440094 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
test/layoutengine/standard-testcases/footnote-create_new_page.xml [deleted file]
test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple.xml [new file with mode: 0644]
test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple_whole.xml [new file with mode: 0644]
test/layoutengine/standard-testcases/footnote_footnote-only-final-page_several-pages.xml [new file with mode: 0644]
test/layoutengine/standard-testcases/footnote_footnote-only-final-page_simple.xml [new file with mode: 0644]
test/layoutengine/standard-testcases/footnote_overflow-to-empty-page.xml [deleted file]
test/layoutengine/standard-testcases/footnote_overflow-to-multiple-pages.xml [deleted file]

index 4fa138da548b3176b995e7e242d7697f300fe91b..dce290b50926fccd3239dbf7c66bc621845d4e65 100644 (file)
@@ -885,19 +885,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
 
         // create pages containing the remaining footnote bodies
         while (insertedFootnotesLength < totalFootnotesLength) {
-            final int tmpLength = lengthList.get(footnoteListIndex);
-            // check if last footnote has already been added completely
-            if (insertedFootnotesLength == tmpLength) {
-                footnoteListIndex++;
-                footnoteElementIndex
-                    = getFootnoteList(footnoteListIndex).size() - 1;
-            } else if ((tmpLength - insertedFootnotesLength) <= availableBPD) {
-                // try adding some more content
-                // add a whole footnote
-                availableBPD -= tmpLength - insertedFootnotesLength;
-                insertedFootnotesLength = tmpLength;
-                footnoteElementIndex
-                    = getFootnoteList(footnoteListIndex).size() - 1;
+            if (totalFootnotesLength - insertedFootnotesLength <= availableBPD) {
+                // All the remaining footnotes fit
+                insertedFootnotesLength = totalFootnotesLength;
+                footnoteListIndex = lengthList.size() - 1;
+                footnoteElementIndex = getFootnoteList(footnoteListIndex).size() - 1;
             } else if ((split = getFootnoteSplit                // CSOK: InnerAssignment
                         (footnoteListIndex, footnoteElementIndex,
                          insertedFootnotesLength, availableBPD, true)) > 0) {
diff --git a/test/layoutengine/standard-testcases/footnote-create_new_page.xml b/test/layoutengine/standard-testcases/footnote-create_new_page.xml
deleted file mode 100644 (file)
index 9092f0d..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-<?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 a footnote that requires a new page.</p>
- </info>
- <fo>
-  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
-   font-family="serif" font-size="11pt">
-   <fo:layout-master-set>
-    <fo:simple-page-master page-height="10cm"
-     page-width="10cm" master-name="simplepage">
-     <fo:region-body region-name="body" />
-    </fo:simple-page-master>
-   </fo:layout-master-set>
-   <fo:page-sequence master-reference="simplepage">
-    <fo:flow flow-name="body">
-     <fo:block margin-top="8.0cm">
-      .... cities
-      <fo:footnote>
-       <fo:inline>(1)</fo:inline>
-       <fo:footnote-body>
-        <fo:block>1. Lisbon, Chicago, London</fo:block>
-       </fo:footnote-body>
-      </fo:footnote>
-      , veggies
-      <fo:footnote>
-       <fo:inline>(2)</fo:inline>
-       <fo:footnote-body>
-        <fo:block>2. Lettuce.</fo:block>
-        <fo:block>2. Garlic.</fo:block>
-        <fo:block>2. Potato.</fo:block>
-       </fo:footnote-body>
-      </fo:footnote>
-      , and fruits
-      <fo:footnote>
-       <fo:inline>(3)</fo:inline>
-       <fo:footnote-body>
-        <fo:block>3. Apple, Coconut, Plum, Kiwi, Canteloupe, Tomato,
-         Clementine, Grapefruit, Guava, Quincy, Lemon, Blueberry,
-         Raspberry, Pomegranate, Watermelon, Orange, Cherry, Peach,
-         Banana, Mango, Pear, Melon, Apricot, Pineapple, Strawberry,
-         Persimon, Medlar. 
-        </fo:block>
-       </fo:footnote-body>
-      </fo:footnote>
-      .
-     </fo:block>
-    </fo:flow>
-   </fo:page-sequence>
-  </fo:root>
- </fo>
- <checks>
-  <eval expected="1"
-   xpath="//lineArea[starts-with(., '.... cities')]/ancestor::pageViewport/@nr" />
-  <eval expected="2"
-   xpath="//lineArea[starts-with(., '2. Potato.')]/ancestor::pageViewport/@nr" />
- </checks>
-</testcase>
\ No newline at end of file
diff --git a/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple.xml b/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple.xml
new file mode 100644 (file)
index 0000000..9092f0d
--- /dev/null
@@ -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 a footnote that requires a new page.</p>
+ </info>
+ <fo>
+  <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
+   font-family="serif" font-size="11pt">
+   <fo:layout-master-set>
+    <fo:simple-page-master page-height="10cm"
+     page-width="10cm" master-name="simplepage">
+     <fo:region-body region-name="body" />
+    </fo:simple-page-master>
+   </fo:layout-master-set>
+   <fo:page-sequence master-reference="simplepage">
+    <fo:flow flow-name="body">
+     <fo:block margin-top="8.0cm">
+      .... cities
+      <fo:footnote>
+       <fo:inline>(1)</fo:inline>
+       <fo:footnote-body>
+        <fo:block>1. Lisbon, Chicago, London</fo:block>
+       </fo:footnote-body>
+      </fo:footnote>
+      , veggies
+      <fo:footnote>
+       <fo:inline>(2)</fo:inline>
+       <fo:footnote-body>
+        <fo:block>2. Lettuce.</fo:block>
+        <fo:block>2. Garlic.</fo:block>
+        <fo:block>2. Potato.</fo:block>
+       </fo:footnote-body>
+      </fo:footnote>
+      , and fruits
+      <fo:footnote>
+       <fo:inline>(3)</fo:inline>
+       <fo:footnote-body>
+        <fo:block>3. Apple, Coconut, Plum, Kiwi, Canteloupe, Tomato,
+         Clementine, Grapefruit, Guava, Quincy, Lemon, Blueberry,
+         Raspberry, Pomegranate, Watermelon, Orange, Cherry, Peach,
+         Banana, Mango, Pear, Melon, Apricot, Pineapple, Strawberry,
+         Persimon, Medlar. 
+        </fo:block>
+       </fo:footnote-body>
+      </fo:footnote>
+      .
+     </fo:block>
+    </fo:flow>
+   </fo:page-sequence>
+  </fo:root>
+ </fo>
+ <checks>
+  <eval expected="1"
+   xpath="//lineArea[starts-with(., '.... cities')]/ancestor::pageViewport/@nr" />
+  <eval expected="2"
+   xpath="//lineArea[starts-with(., '2. Potato.')]/ancestor::pageViewport/@nr" />
+ </checks>
+</testcase>
\ No newline at end of file
diff --git a/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple_whole.xml b/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_multiple_whole.xml
new file mode 100644 (file)
index 0000000..bbddde9
--- /dev/null
@@ -0,0 +1,82 @@
+<?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>When a footnote-only final page must be created, check the case where the final page starts on 
+    a footnote that must be split over several pages.</p>
+ </info>
+ <fo>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+  <fo:layout-master-set>
+    <fo:simple-page-master master-name="page"
+      page-height="120pt" page-width="220pt" margin="10pt">
+      <fo:region-body background-color="#F0F0F0"/>
+    </fo:simple-page-master>
+    <fo:simple-page-master master-name="small"
+      page-height="120pt" page-width="220pt" margin="10pt">
+      <fo:region-body margin-top="45pt" margin-bottom="45pt" background-color="#F0F0F0"/>
+    </fo:simple-page-master>
+    <fo:page-sequence-master master-name="pages">
+      <fo:single-page-master-reference master-reference="page"/>
+      <fo:single-page-master-reference master-reference="small"/>
+      <fo:repeatable-page-master-reference master-reference="page"/>
+    </fo:page-sequence-master>
+  </fo:layout-master-set>
+
+  <fo:page-sequence master-reference="pages">
+    <fo:flow flow-name="xsl-region-body" text-align="justify" font-size="8pt" line-height="10pt">
+      <fo:block space-before="50pt" space-before.conditionality="retain">Foonote call <fo:footnote>
+          <fo:inline>1</fo:inline>
+          <fo:footnote-body>
+            <fo:block>
+              <fo:block>Footnote 1</fo:block>
+            </fo:block>
+          </fo:footnote-body>
+          </fo:footnote>, <fo:footnote>
+          <fo:inline>2</fo:inline>
+          <fo:footnote-body>
+            <fo:block>
+              <fo:block>Footnote 2.1</fo:block>
+              <fo:block>Footnote 2.2</fo:block>
+              <fo:block>Footnote 2.3</fo:block>
+            </fo:block>
+          </fo:footnote-body>
+          </fo:footnote>, and <fo:footnote>
+          <fo:inline>3</fo:inline>
+          <fo:footnote-body>
+            <fo:block>
+              <fo:block>Footnote 3.1</fo:block>
+              <fo:block>Footnote 3.2</fo:block>
+              <fo:block>Footnote 3.3</fo:block>
+            </fo:block>
+          </fo:footnote-body>
+      </fo:footnote>.</fo:block>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
+ </fo>
+ <checks>
+   <eval expected="2"      xpath="count(//pageViewport[1]//footnote/block)"/>
+   <eval expected="3"      xpath="count(//pageViewport[1]//footnote/block[2]/block)"/>
+   <eval expected="Footnote 2.1" xpath="//pageViewport[1]//footnote/block[2]/block[1]"/>
+   <eval expected="Footnote 2.2" xpath="//pageViewport[1]//footnote/block[2]/block[2]"/>
+   <eval expected="Footnote 2.3" xpath="//pageViewport[1]//footnote/block[2]/block[3]"/>
+   <eval expected="1"      xpath="count(//pageViewport[2]//footnote/block)"/>
+   <eval expected="1"      xpath="count(//pageViewport[2]//footnote/block/block)"/>
+   <eval expected="Footnote 3.1" xpath="//pageViewport[2]//footnote/block/block"/>
+   <eval expected="1"      xpath="count(//pageViewport[3]//footnote/block)"/>
+   <eval expected="2"      xpath="count(//pageViewport[3]//footnote/block/block)"/>
+   <eval expected="Footnote 3.2" xpath="//pageViewport[3]//footnote/block/block[1]"/>
+   <eval expected="Footnote 3.3" xpath="//pageViewport[3]//footnote/block/block[2]"/>
+ </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_several-pages.xml b/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_several-pages.xml
new file mode 100644 (file)
index 0000000..25f2c8a
--- /dev/null
@@ -0,0 +1,106 @@
+<?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.
+-->
+<testcase>
+  <info>
+    <p>
+      This test checks the creation of two pages containing the remaining of a footnote and no content lines.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple"
+                                page-height="841.9pt"
+                                page-width="595.3pt"
+                                margin-top="112.42pt"
+                                margin-bottom="69.48pt"
+                                margin-left="99.88pt"
+                                margin-right="99.88pt">
+          <fo:region-body margin-top="120pt"
+                          margin-bottom="140pt"
+                          background-color="lightgrey"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="simple">
+        <fo:flow flow-name="xsl-region-body" font-family="Courier">
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1.  There is a footnote citation in the last</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2.  content line of this page.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3.  The footnote body does not fit in the</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4.  remaining space so it is broken: il will fill</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5.  a page and will end in another one.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6.  ---------+---------+---------+---------+------</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+            <fo:footnote>
+              <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
+              <fo:footnote-body>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> footnote line 1/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/23.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/23.</fo:block>
+              </fo:footnote-body>
+            </fo:footnote>
+          </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="3" xpath="count(//pageViewport)"/>
+    <!-- last content line in page 1 -->
+    <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+    <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
+    <!-- last footnote line in page 1 -->
+    <eval expected="footnote line 2/23." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+    <!-- first footnote line in page 2 -->
+    <eval expected="footnote line 3/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+    <!-- last footnote line in page 2 -->
+    <eval expected="footnote line 22/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+    <!-- first footnote line in page 3 -->
+    <eval expected="footnote line 23/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+  </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_simple.xml b/test/layoutengine/standard-testcases/footnote_footnote-only-final-page_simple.xml
new file mode 100644 (file)
index 0000000..8220e60
--- /dev/null
@@ -0,0 +1,82 @@
+<?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.
+-->
+<testcase>
+  <info>
+    <p>
+      This test checks the creation of a page containing the remaining of a footnote and no content lines.
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+      <fo:layout-master-set>
+        <fo:simple-page-master master-name="simple"
+                                page-height="841.9pt"
+                                page-width="595.3pt"
+                                margin-top="112.42pt"
+                                margin-bottom="69.48pt"
+                                margin-left="99.88pt"
+                                margin-right="99.88pt">
+          <fo:region-body margin-top="120pt"
+                          margin-bottom="140pt"
+                          background-color="lightgrey"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence master-reference="simple">
+        <fo:flow flow-name="xsl-region-body" font-family="Courier">
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1.  There is a footnote citation in the last</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2.  content line of this page.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3.  The footnote body does not fit in the</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4.  remaining space so it is broken: the last</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5.  part of it will be placed in a new page</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6.  with no content lines.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.  ---------+---------+---------+---------+------</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
+          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
+            <fo:footnote>
+              <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
+              <fo:footnote-body>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> footnote line 1/3.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/3.</fo:block>
+                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/3.</fo:block>
+              </fo:footnote-body>
+            </fo:footnote>
+          </fo:block>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="2" xpath="count(//pageViewport)"/>
+    <!-- last content line in page 1 -->
+    <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
+    <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
+    <!-- last footnote line in page 1 -->
+    <eval expected="footnote line 2/3." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
+    <!-- first footnote line in page 2 -->
+    <eval expected="footnote line 3/3." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
+  </checks>
+</testcase>
diff --git a/test/layoutengine/standard-testcases/footnote_overflow-to-empty-page.xml b/test/layoutengine/standard-testcases/footnote_overflow-to-empty-page.xml
deleted file mode 100644 (file)
index 8220e60..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<?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.
--->
-<testcase>
-  <info>
-    <p>
-      This test checks the creation of a page containing the remaining of a footnote and no content lines.
-    </p>
-  </info>
-  <fo>
-    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
-      <fo:layout-master-set>
-        <fo:simple-page-master master-name="simple"
-                                page-height="841.9pt"
-                                page-width="595.3pt"
-                                margin-top="112.42pt"
-                                margin-bottom="69.48pt"
-                                margin-left="99.88pt"
-                                margin-right="99.88pt">
-          <fo:region-body margin-top="120pt"
-                          margin-bottom="140pt"
-                          background-color="lightgrey"/>
-        </fo:simple-page-master>
-      </fo:layout-master-set>
-      <fo:page-sequence master-reference="simple">
-        <fo:flow flow-name="xsl-region-body" font-family="Courier">
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1.  There is a footnote citation in the last</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2.  content line of this page.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3.  The footnote body does not fit in the</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4.  remaining space so it is broken: the last</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5.  part of it will be placed in a new page</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6.  with no content lines.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.  ---------+---------+---------+---------+------</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
-            <fo:footnote>
-              <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
-              <fo:footnote-body>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> footnote line 1/3.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/3.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/3.</fo:block>
-              </fo:footnote-body>
-            </fo:footnote>
-          </fo:block>
-        </fo:flow>
-      </fo:page-sequence>
-    </fo:root>
-  </fo>
-  <checks>
-    <eval expected="2" xpath="count(//pageViewport)"/>
-    <!-- last content line in page 1 -->
-    <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
-    <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
-    <!-- last footnote line in page 1 -->
-    <eval expected="footnote line 2/3." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
-    <!-- first footnote line in page 2 -->
-    <eval expected="footnote line 3/3." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
-  </checks>
-</testcase>
diff --git a/test/layoutengine/standard-testcases/footnote_overflow-to-multiple-pages.xml b/test/layoutengine/standard-testcases/footnote_overflow-to-multiple-pages.xml
deleted file mode 100644 (file)
index 25f2c8a..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?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.
--->
-<testcase>
-  <info>
-    <p>
-      This test checks the creation of two pages containing the remaining of a footnote and no content lines.
-    </p>
-  </info>
-  <fo>
-    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
-      <fo:layout-master-set>
-        <fo:simple-page-master master-name="simple"
-                                page-height="841.9pt"
-                                page-width="595.3pt"
-                                margin-top="112.42pt"
-                                margin-bottom="69.48pt"
-                                margin-left="99.88pt"
-                                margin-right="99.88pt">
-          <fo:region-body margin-top="120pt"
-                          margin-bottom="140pt"
-                          background-color="lightgrey"/>
-        </fo:simple-page-master>
-      </fo:layout-master-set>
-      <fo:page-sequence master-reference="simple">
-        <fo:flow flow-name="xsl-region-body" font-family="Courier">
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 1.  There is a footnote citation in the last</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 2.  content line of this page.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 3.  The footnote body does not fit in the</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 4.  remaining space so it is broken: il will fill</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 5.  a page and will end in another one.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 6.  ---------+---------+---------+---------+------</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 7.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 8.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 9.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 10.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 11.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 12.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 13.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 14.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 15.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 16.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 17.</fo:block>
-          <fo:block background-color="white" line-height="20pt" line-stacking-strategy="font-height">line 18.
-            <fo:footnote>
-              <fo:inline font-size="50%" vertical-align="top">1</fo:inline>
-              <fo:footnote-body>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height"><fo:inline font-size="50%" vertical-align="top">1</fo:inline> footnote line 1/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 2/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 3/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 4/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 5/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 6/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 7/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 8/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 9/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 10/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 11/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 12/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 13/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 14/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 15/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 16/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 17/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 18/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 19/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 20/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 21/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 22/23.</fo:block>
-                <fo:block background-color="pink" line-height="20pt" line-stacking-strategy="font-height">footnote line 23/23.</fo:block>
-              </fo:footnote-body>
-            </fo:footnote>
-          </fo:block>
-        </fo:flow>
-      </fo:page-sequence>
-    </fo:root>
-  </fo>
-  <checks>
-    <eval expected="3" xpath="count(//pageViewport)"/>
-    <!-- last content line in page 1 -->
-    <eval expected="line 18. " xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/text[1]"/>
-    <eval expected="1" xpath="//pageViewport[1]/page/regionViewport/regionBody/mainReference/span/flow/block[last()]/lineArea/inlineparent/text[1]"/>
-    <!-- last footnote line in page 1 -->
-    <eval expected="footnote line 2/23." xpath="//pageViewport[1]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
-    <!-- first footnote line in page 2 -->
-    <eval expected="footnote line 3/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
-    <!-- last footnote line in page 2 -->
-    <eval expected="footnote line 22/23." xpath="//pageViewport[2]/page/regionViewport/regionBody/footnote//block[last()]/lineArea/text[1]"/>
-    <!-- first footnote line in page 3 -->
-    <eval expected="footnote line 23/23." xpath="//pageViewport[3]/page/regionViewport/regionBody/footnote//block[1]/lineArea/text[1]"/>
-  </checks>
-</testcase>