Author: ssteiner
Date: Mon Jun 19 15:22:38 2017
New Revision: 1799220
URL: http://svn.apache.org/viewvc?rev=1799220&view=rev
Log:
FOP-2713: Text missing on last page with changing ipd
Added:
xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml (with props)
Modified:
xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java
Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java?rev=1799220&r1=1799219&r2=1799220&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java Mon Jun 19 15:22:38 2017
@@ -467,16 +467,19 @@ public class PageBreaker extends Abstrac
*/
}
} else {
- if (fitsOnePage) {
+ boolean ipdChange = algRestart.getIPDdifference() != 0;
+ if (fitsOnePage && !ipdChange) {
//Replace last page
pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
} else {
//Last page-master cannot hold the content.
//Add areas now...
addAreas(alg, restartPoint, partCount - restartPoint, originalList, effectiveList);
- //...and add a blank last page
- setLastPageIndex(currentPageNum + 1);
- pslm.setCurrentPage(pslm.makeNewPage(true));
+ if (!ipdChange) {
+ //...and add a blank last page
+ setLastPageIndex(currentPageNum + 1);
+ pslm.setCurrentPage(pslm.makeNewPage(true));
+ }
return;
}
}
Added: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml?rev=1799220&view=auto
==============================================================================
--- xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml (added)
+++ xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml Mon Jun 19 15:22:38 2017
@@ -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 master-name="BlankPage" page-width="8.5in" page-height="11in" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in">
+ <fo:region-body margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in" background-color="yellow"/>
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="NotesPage" page-width="8.5in" page-height="11in" margin-bottom="0.5in" margin-right="0.5in" margin-top="0.5in" margin-left="0.5in">
+ <fo:region-body margin-bottom="0in" margin-right="0in" margin-top="0in" margin-left="0in" region-name="NotesBody" background-color="green"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="OddPage" page-width="8.5in" page-height="11in" margin-bottom="0.2in" margin-right="0.4in" margin-top="0.5in" margin-left="0.4in">
+ <fo:region-body margin-bottom="0.5in" margin-right="0in" margin-top="3.4in" margin-left="0in" region-name="Body" background-color="blue"/>
+
+ </fo:simple-page-master>
+ <fo:simple-page-master master-name="StubPage" page-width="8.5in" page-height="11in" margin-bottom="0.5in" margin-right="0.4in" margin-top="0.5in" margin-left="0.4in">
+ <fo:region-body margin-bottom="3.6in" margin-right="0in" margin-top="3.6in" margin-left="0in" region-name="Body" background-color="red"/>
+
+ </fo:simple-page-master>
+ <fo:page-sequence-master master-name="LetterPages">
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference page-position="last" master-reference="StubPage"/>
+ <fo:conditional-page-master-reference odd-or-even="odd" page-position="first" master-reference="OddPage"/>
+ <fo:conditional-page-master-reference odd-or-even="odd" page-position="rest" master-reference="OddPage"/>
+ <fo:conditional-page-master-reference odd-or-even="even" master-reference="NotesPage"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+ </fo:layout-master-set>
+ <fo:page-sequence format="1" id="th_default_sequence1" force-page-count="end-on-odd" initial-page-number="auto" master-reference="LetterPages">
+
+ <fo:flow flow-name="Body">
+ <fo:block font-size="60pt">hello hello hello hello hello hello hello hello hello hello end</fo:block>
+ </fo:flow>
+ </fo:page-sequence>
+</fo:root>
+</fo>
+ <checks>
+ <eval expected="end" xpath="//pageViewport[1]//lineArea[4]/text[1]/word[2]"/>
+ </checks>
+</testcase>
Propchange: xmlgraphics/fop/trunk/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.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.