svn commit: r1750085 - in /xmlgraphics/fop/trunk: fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml

[email protected]
Newsgroups gmane.text.xml.fop.cvs
Message-ID <[email protected]>
Author: ssteiner
Date: Fri Jun 24 13:10:48 2016
New Revision: 1750085

URL: http://svn.apache.org/viewvc?rev=1750085&view=rev
Log:
FOP-2614: Image missing on change IPD

Added:
    xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml   (with props)
Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java?rev=1750085&r1=1750084&r2=1750085&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java Fri Jun 24 13:10:48 2016
@@ -430,10 +430,13 @@ public abstract class AbstractBreaker {
                     firstElementsForRestart = null;
                     LayoutManager restartAtLM = getRestartAtLM(alg, ipdChangesOnNextPage, onLastPageAndIPDChanges,
                             visitedBefore, blockList, 1);
-                    if (restartAtLM == null) {
+                    if (restartAtLM == null || restartAtLM.getChildLMs().isEmpty()) {
                         firstElementsForRestart = null;
-                        restartAtLM = getRestartAtLM(alg, ipdChangesOnNextPage, onLastPageAndIPDChanges,
+                        LayoutManager restartAtLM2 = getRestartAtLM(alg, ipdChangesOnNextPage, onLastPageAndIPDChanges,
                                 visitedBefore, blockList, 0);
+                        if (restartAtLM2 != null) {
+                            restartAtLM = restartAtLM2;
+                        }
                     }
                     if (ipdChangesOnNextPage) {
                         addAreas(alg, optimalPageCount, blockList, blockList);

Added: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml?rev=1750085&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml (added)
+++ xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml Fri Jun 24 13:10:48 2016
@@ -0,0 +1,64 @@
+<?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 the definition of a special page-master for the last page with a
+      different width that the previous "rest" page causes FOP to redo the line breaking layout.
+    </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-top="0.4in" margin-right="0.4in" margin-left="0.4in" margin-bottom="0.4in" master-name="PageFront" page-width="8.5in" page-height="11in">
+      <fo:region-body region-name="PageBody" margin-bottom="0pt" margin-right="0pt" margin-top="0pt" margin-left="0pt"/>
+    </fo:simple-page-master>
+    <fo:simple-page-master margin-top="0.1in" margin-right="0.1in" margin-left="0.1in" margin-bottom="0.1in" page-width="12in" page-height="12in" master-name="PageRest">
+      <fo:region-body margin-top="0" margin-right="0" margin-left="0" margin-bottom="0" region-name="PageBody"/>
+    </fo:simple-page-master>
+    <fo:simple-page-master page-width="12in" page-height="12in" margin-bottom="0.0in" margin-left="0.0in" margin-right="0.0in" margin-top="0.0in" master-name="PageLast">
+      <fo:region-body margin-top="0.0in" margin-right="0.0in" margin-left="0.0in" margin-bottom="0.0in" region-name="PageBody"/>
+    </fo:simple-page-master>
+    <fo:page-sequence-master master-name="LetterPages">
+      <fo:repeatable-page-master-alternatives>
+        <fo:conditional-page-master-reference page-position="first" master-reference="PageFront"/>
+        <fo:conditional-page-master-reference page-position="rest" master-reference="PageRest"/>
+        <fo:conditional-page-master-reference page-position="last" master-reference="PageLast"/>
+      </fo:repeatable-page-master-alternatives>
+    </fo:page-sequence-master>
+  </fo:layout-master-set>
+  <fo:page-sequence format="1" id="th_default_sequence1" initial-page-number="auto" force-page-count="auto" master-reference="LetterPages">
+    <fo:flow flow-name="PageBody">
+      <fo:block background-color="#F1F1F1">
+        <fo:block>TO DO: Type your text here...</fo:block>
+        <fo:block>
+          <fo:block>
+            <fo:external-graphic scaling="uniform" src="url(a.TIFF)" width="21.945600000000002cm" content-width="21.945600000000002cm" height="28.321cm" content-height="28.321cm" role="CommAdhdForm.tif" fox:alt-text="CommAdhdForm.tif"/>
+          </fo:block>
+        </fo:block>
+      </fo:block>
+      <fo:block id="LastPage"/>
+    </fo:flow>
+  </fo:page-sequence>
+</fo:root>
+</fo>
+  <checks>
+    <eval expected="url(a.TIFF)" xpath="//pageViewport[2]//image/@url"/>
+  </checks>
+</testcase>

Propchange: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_12.xml
------------------------------------------------------------------------------
    svn:eol-style = native
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.