Author: lbernardo
Date: Tue Jun 18 23:04:16 2013
New Revision: 1494364

URL: http://svn.apache.org/r1494364
Log:
FOP-2246: Exception java.lang.IllegalArgumentException: min (1650) > opt (0); 
changes to avoid exception and default to "reasonable" values if no invalid 
value was explicitly provided.

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java?rev=1494364&r1=1494363&r2=1494364&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java 
(original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/SpaceVal.java Tue Jun 
18 23:04:16 2013
@@ -59,6 +59,16 @@ public class SpaceVal {
         int min = spaceprop.getMinimum(context).getLength().getValue(context);
         int opt = spaceprop.getOptimum(context).getLength().getValue(context);
         int max = spaceprop.getMaximum(context).getLength().getValue(context);
+        // if a value is not set defaults to zero
+        if (min > max && max == 0) {
+            max = opt > min ? opt : min;
+        }
+        if (min > opt && opt == 0) {
+            opt = (min + max) / 2;
+        }
+        if (opt > max && max == 0) {
+            max = opt;
+        }
         return MinOptMax.getInstance(min, opt, max);
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to