From eb517b921d2e34fe9bb4c1fb29ff102608967d8a Mon Sep 17 00:00:00 2001 From: Simon Steiner Date: Mon, 19 Jun 2017 15:22:38 +0000 Subject: [PATCH] FOP-2713: Text missing on last page with changing ipd git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1799220 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/layoutmgr/PageBreaker.java | 11 ++-- .../flow_changing-ipd_last-page_14.xml | 64 +++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java index 43fca99a2..6096fef93 100644 --- a/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java +++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java @@ -467,16 +467,19 @@ public class PageBreaker extends AbstractBreaker { */ } } 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; } } diff --git a/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml b/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml new file mode 100644 index 000000000..b3122b732 --- /dev/null +++ b/fop/test/layoutengine/standard-testcases/flow_changing-ipd_last-page_14.xml @@ -0,0 +1,64 @@ + + + + + +

+ 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. +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + hello hello hello hello hello hello hello hello hello hello end + + + + + + + +
-- 2.39.5