You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ss...@apache.org on 2023/02/21 08:49:47 UTC

svn commit: r1907782 - in /xmlgraphics/fop/trunk: fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml

Author: ssteiner
Date: Tue Feb 21 08:49:47 2023
New Revision: 1907782

URL: http://svn.apache.org/viewvc?rev=1907782&view=rev
Log:
FOP-3118: Text missing after page break inside table inline

Added:
    xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java?rev=1907782&r1=1907781&r2=1907782&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java Tue Feb 21 08:49:47 2023
@@ -67,13 +67,13 @@ public final class AreaAdditionUtil {
             }
             if (pos instanceof NonLeafPosition && pos.getPosition() != null) {
                 // pos was created by a child of this FlowLM
-                positionList.add(pos.getPosition());
-                lastLM = (pos.getPosition().getLM());
+                add(pos.getPosition(), positionList);
+                lastLM = pos.getPosition().getLM();
                 if (firstLM == null) {
                     firstLM = lastLM;
                 }
             } else if (pos instanceof SpaceHandlingBreakPosition) {
-                positionList.add(pos);
+                add(pos, positionList);
             } else {
                 // pos was created by this LM, so it must be ignored
             }
@@ -119,8 +119,11 @@ public final class AreaAdditionUtil {
                     parentLM.isFirst(firstPos),
                     parentLM.isLast(lastPos));
         }
-
-
     }
 
+    private static void add(Position pos, LinkedList<Position> positionList) {
+        if (!positionList.isEmpty() || pos.getLM() != null) {
+            positionList.add(pos);
+        }
+    }
 }

Added: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml?rev=1907782&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml (added)
+++ xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml Tue Feb 21 08:49:47 2023
@@ -0,0 +1,57 @@
+<?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 table inline page break
+    </p>
+  </info>
+  <fo>
+    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">
+      <fo:layout-master-set>
+        <fo:simple-page-master margin-right="1in" margin-left="1in" margin-bottom="1in" margin-top="1in" page-width="8.5in" page-height="11in" master-name="Page">
+          <fo:region-body margin-right="0in" margin-left="0in" margin-bottom="0.50in" margin-top="0in" region-name="Body"/>
+        </fo:simple-page-master>
+      </fo:layout-master-set>
+      <fo:page-sequence format="1" id="TH_LastPage" master-reference="Page">
+        <fo:flow flow-name="Body">
+          <fo:table table-layout="fixed" width="100%">
+            <fo:table-column column-width="proportional-column-width(100)" column-number="1"/>
+            <fo:table-body>
+              <fo:table-row>
+                <fo:table-cell>
+                  <fo:block>
+                    <fo:inline>
+                      <fo:leader/>
+                      <fo:block break-before="page"/>This is an example of a Table</fo:inline>
+                  </fo:block>
+                </fo:table-cell>
+              </fo:table-row>
+            </fo:table-body>
+          </fo:table>
+        </fo:flow>
+      </fo:page-sequence>
+    </fo:root>
+  </fo>
+  <checks>
+    <eval expected="2" xpath="count(//pageViewport)"/>
+    <eval expected="This" xpath="//pageViewport[2]//word[1]"/>
+    <eval expected="Table" xpath="//pageViewport[2]//word[7]"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/table-inline-pagebreak.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org