aboutsummaryrefslogtreecommitdiffstats
path: root/fop-core/src
diff options
context:
space:
mode:
authorSimon Steiner <ssteiner@apache.org>2024-06-21 11:01:46 +0100
committerSimon Steiner <ssteiner@apache.org>2024-06-21 11:01:46 +0100
commit12e2889f4e86bd99cb2bc5e5a183e275e22c91de (patch)
tree3413ec222571c3ecadc2825cadd4e9e6d12c2c01 /fop-core/src
parentb8a6ee005de66e26ba4418c611985f68f323e230 (diff)
downloadxmlgraphics-fop-12e2889f4e86bd99cb2bc5e5a183e275e22c91de.tar.gz
xmlgraphics-fop-12e2889f4e86bd99cb2bc5e5a183e275e22c91de.zip
FOP-3186: Only support 1 column for redo of layout without page pos only
Diffstat (limited to 'fop-core/src')
-rw-r--r--fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java
index f6bf00253..40b518af3 100644
--- a/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java
+++ b/fop-core/src/main/java/org/apache/fop/layoutmgr/AbstractBreaker.java
@@ -26,6 +26,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.fop.fo.Constants;
+import org.apache.fop.fo.pagination.RegionBody;
import org.apache.fop.layoutmgr.BreakingAlgorithm.KnuthNode;
import org.apache.fop.traits.MinOptMax;
import org.apache.fop.util.ListUtil;
@@ -415,8 +416,7 @@ public abstract class AbstractBreaker {
onLastPageAndIPDChanges = (lastPageHasIPDChange(optimalPageCount) && !thereIsANonRestartableLM(alg)
&& (shouldRedoLayout() || (wasLayoutRedone() && optimalPageCount > 1)));
}
- if ((ipdChangesOnNextPage || hasMoreContent() || optimalPageCount > 1)
- && pslm != null && pslm.getCurrentPage().isPagePositionOnly) {
+ if (shouldRedoLayoutWithoutPagePositionOnly(ipdChangesOnNextPage, optimalPageCount)) {
return false;
}
if (alg.handlingFloat()) {
@@ -465,6 +465,15 @@ public abstract class AbstractBreaker {
return true;
}
+ private boolean shouldRedoLayoutWithoutPagePositionOnly(boolean ipdChangesOnNextPage, int optimalPageCount) {
+ if ((ipdChangesOnNextPage || hasMoreContent() || optimalPageCount > 1)
+ && pslm != null && pslm.getCurrentPage().isPagePositionOnly) {
+ RegionBody rb = (RegionBody)pslm.getCurrentPage().getSimplePageMaster().getRegion(Constants.FO_REGION_BODY);
+ return rb.getColumnCount() == 1;
+ }
+ return false;
+ }
+
/**
* Returns {@code true} if the given position or one of its descendants
* corresponds to a non-restartable LM.