diff options
author | Simon Steiner <ssteiner@apache.org> | 2020-07-21 13:28:42 +0000 |
---|---|---|
committer | Simon Steiner <ssteiner@apache.org> | 2020-07-21 13:28:42 +0000 |
commit | c020f2f4678ec65ba9591b953faf73c5935c45f2 (patch) | |
tree | 24f10e536011886ac421231b4cd9d561768ca486 /fop-core | |
parent | 83f9092f85199c3d138914088916a1e4ae5a6d2c (diff) | |
download | xmlgraphics-fop-c020f2f4678ec65ba9591b953faf73c5935c45f2.tar.gz xmlgraphics-fop-c020f2f4678ec65ba9591b953faf73c5935c45f2.zip |
FOP-2957: Don't change ipd on lastpage if column count changes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1880106 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'fop-core')
-rw-r--r-- | fop-core/src/main/java/org/apache/fop/layoutmgr/PageBreaker.java | 7 |
1 files changed, 5 insertions, 2 deletions
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 d6575e5f9..b1babb12a 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 @@ -68,6 +68,7 @@ public class PageBreaker extends AbstractBreaker { private MinOptMax relayedFootnoteSeparatorLength; private int previousFootnoteListIndex = -2; private int previousFootnoteElementIndex = -2; + private int prevousColumnCount; /** * The FlowLayoutManager object, which processes @@ -712,8 +713,10 @@ public class PageBreaker extends AbstractBreaker { boolean onlyPageMasterDefined = pslm.getPageSequence().hasPagePositionOnly(); if (lastPageMasterDefined && !onlyPageMasterDefined) { // code not very robust and unable to handle situations were only and last are defined - if (pageProvider.getCurrentColumnCount() > 1 - && optimalPageCount % pageProvider.getCurrentColumnCount() == 0) { + int currentColumnCount = pageProvider.getCurrentColumnCount(); + boolean changeInColumnCount = prevousColumnCount > 0 && prevousColumnCount != currentColumnCount; + prevousColumnCount = currentColumnCount; + if ((currentColumnCount > 1 && optimalPageCount % currentColumnCount == 0) || changeInColumnCount) { return false; } int currentIPD = this.pageProvider.getCurrentIPD(); |