From: Jeremias Maerki Date: Tue, 4 Mar 2008 17:30:40 +0000 (+0000) Subject: Bugfix: If there's shrink available in an auto-height situation, the difference is... X-Git-Tag: fop-0_95beta~20 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ac24860f95758975e6e7cf51aeb203a9ed02cb30;p=xmlgraphics-fop.git Bugfix: If there's shrink available in an auto-height situation, the difference is now set to 0 in order to avoid unwanted effects. IOW, never shrink in an auto-height situation. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@633557 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 57fc4600e..d98d29b5c 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -364,7 +364,13 @@ class PageBreakingAlgorithm extends BreakingAlgorithm { } else { // there are no footnotes } - return getLineWidth(activeNode.line) - actualWidth; + int diff = getLineWidth(activeNode.line) - actualWidth; + if (autoHeight && diff < 0) { + //getLineWidth() for auto-height parts return 0 so the diff will be negative + return 0; //...but we don't want to shrink in this case. Stick to optimum. + } else { + return diff; + } } /** Checks whether footnotes from preceding pages may be deferred to the page after diff --git a/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_3.xml b/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_3.xml new file mode 100644 index 000000000..d2eba0d3c --- /dev/null +++ b/test/layoutengine/standard-testcases/block-container_absolute-position_no-height_3.xml @@ -0,0 +1,63 @@ + + + + + +

+ This test checks absolutely positioned block-containers with auto-height and shrinks. +

+
+ + + + + + + + + + + + Lorem ipsum dolor sit amet. + + + Lorem ipsum dolor sit amet. + + + Lorem ipsum dolor sit amet. + + + + + + + + + + + + + + +