diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2012-11-19 16:57:05 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2012-11-19 16:57:05 +0000 |
commit | ff6508e118c14d1e8eb270a559d147e85bf0418f (patch) | |
tree | 3fcd2afc56e5c1daa6b0738ad7234318cac13270 /src/java/org | |
parent | e79feb700fcf7112e67f511785487f91d7f13376 (diff) | |
download | xmlgraphics-fop-ff6508e118c14d1e8eb270a559d147e85bf0418f.tar.gz xmlgraphics-fop-ff6508e118c14d1e8eb270a559d147e85bf0418f.zip |
Bugzilla #54167: Disable the overflow recovery mechanism when the flow IPD changes
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1411306 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java index 3830878fe..02c3db6a8 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java @@ -460,6 +460,10 @@ public abstract class BreakingAlgorithm { return this.partOverflowRecoveryActivated; } + protected KnuthNode getLastTooLong() { + return lastTooLong; + } + /** * Empty method, hook for subclasses. Called before determining the optimal * breakpoints corresponding to a given active node. diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 89bc339bc..4fa138da5 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -1108,6 +1108,19 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { } + @Override + protected KnuthNode recoverFromOverflow() { + if (compareIPDs(getLastTooLong().line - 1) != 0) { + /** + * If the IPD of the next page changes, disable the recovery mechanism as the + * inline content has to be re-laid out according to the new IPD anyway. + */ + return getLastTooLong(); + } else { + return super.recoverFromOverflow(); + } + } + /** {@inheritDoc} */ @Override protected int getIPDdifference() { |