From: Vincent Hennebert Date: Fri, 30 Jan 2009 18:56:34 +0000 (+0000) Subject: Bugzilla #46638: MinOptMaxUtil.toMinOptMax was converting LengthRangeProperty objects... X-Git-Tag: fop-1_0~330 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=34856199208b84891a449d0d97fd11e0803f8e8f;p=xmlgraphics-fop.git Bugzilla #46638: MinOptMaxUtil.toMinOptMax was converting LengthRangeProperty objects into illegal MinOptMax objects (in some cases opt could be inferior to min). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@739376 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java index 155abcd39..f029d9082 100644 --- a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java +++ b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java @@ -103,15 +103,13 @@ public class MinOptMaxUtil { * @return the requested MinOptMax instance */ public static MinOptMax toMinOptMax(LengthRangeProperty prop, PercentBaseContext context) { - MinOptMax mom = new MinOptMax( - (prop.getMinimum(context).isAuto() - ? 0 : prop.getMinimum(context).getLength().getValue(context)), - (prop.getOptimum(context).isAuto() - ? 0 : prop.getOptimum(context).getLength().getValue(context)), - (prop.getMaximum(context).isAuto() - ? Integer.MAX_VALUE - : prop.getMaximum(context).getLength().getValue(context))); - return mom; + int min = prop.getMinimum(context).isAuto() ? 0 + : prop.getMinimum(context).getLength().getValue(context); + int opt = prop.getOptimum(context).isAuto() ? min + : prop.getOptimum(context).getLength().getValue(context); + int max = prop.getMaximum(context).isAuto() ? Integer.MAX_VALUE + : prop.getMaximum(context).getLength().getValue(context); + return new MinOptMax(min, opt, max); } } diff --git a/status.xml b/status.xml index 0b261fec6..64e3dbd1a 100644 --- a/status.xml +++ b/status.xml @@ -58,6 +58,10 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + MinOptMaxUtil.toMinOptMax was converting LengthRangeProperty objects into illegal MinOptMax + objects (in some cases opt could be inferior to min). + Added extension to disable column balancing before blocks spanning the whole page, in multiple-column documents.