diff options
author | Luis Bernardo <lbernardo@apache.org> | 2013-04-30 23:25:18 +0000 |
---|---|---|
committer | Luis Bernardo <lbernardo@apache.org> | 2013-04-30 23:25:18 +0000 |
commit | 4726c4f941c2179152a3c27e0dc7f62147e825f3 (patch) | |
tree | 4e0411f3e37be3c26fd5e1b04c847aa2ace6ca5e /src/java/org/apache/fop/fo | |
parent | ca4802ab78be99b8a2cb4fc617a788c49938f5da (diff) | |
download | xmlgraphics-fop-4726c4f941c2179152a3c27e0dc7f62147e825f3.tar.gz xmlgraphics-fop-4726c4f941c2179152a3c27e0dc7f62147e825f3.zip |
FOP-2245: height attribute on external-graphic with percentage value behaves incorrectly
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1477872 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo')
-rw-r--r-- | src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java | 30 | ||||
-rw-r--r-- | src/java/org/apache/fop/fo/properties/EnumNumber.java | 3 |
2 files changed, 15 insertions, 18 deletions
diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java index e99c8c7be..3d6b7df5b 100644 --- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java +++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java @@ -142,15 +142,23 @@ public class RelativeNumericProperty extends Property implements Length { * Return the resolved (calculated) value of the expression. * {@inheritDoc} */ - public double getNumericValue() throws PropertyException { - return getResolved(null).getNumericValue(null); + public double getNumericValue() { + try { + return getResolved(null).getNumericValue(null); + } catch (PropertyException pe) { + throw new RuntimeException(pe); + } } /** * {@inheritDoc} */ - public double getNumericValue(PercentBaseContext context) throws PropertyException { - return getResolved(context).getNumericValue(context); + public double getNumericValue(PercentBaseContext context) { + try { + return getResolved(context).getNumericValue(context); + } catch (PropertyException pe) { + throw new RuntimeException(pe); + } } /** @@ -193,24 +201,14 @@ public class RelativeNumericProperty extends Property implements Length { * {@inheritDoc} */ public int getValue() { - try { - return (int) getNumericValue(); - } catch (PropertyException exc) { - log.error(exc); - } - return 0; + return (int) getNumericValue(); } /** * {@inheritDoc} */ public int getValue(PercentBaseContext context) { - try { - return (int) getNumericValue(context); - } catch (PropertyException exc) { - log.error(exc); - } - return 0; + return (int) getNumericValue(context); } /** diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java index 9c018e0eb..dfe1eb877 100644 --- a/src/java/org/apache/fop/fo/properties/EnumNumber.java +++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java @@ -21,7 +21,6 @@ package org.apache.fop.fo.properties; import org.apache.fop.datatypes.Numeric; import org.apache.fop.datatypes.PercentBaseContext; -import org.apache.fop.fo.expr.PropertyException; import org.apache.fop.util.CompareUtil; /** @@ -104,7 +103,7 @@ public final class EnumNumber extends Property implements Numeric { * {@inheritDoc} * logs an error, because it's not supposed to be called */ - public double getNumericValue(PercentBaseContext context) throws PropertyException { + public double getNumericValue(PercentBaseContext context) { log.error("getNumericValue() called on " + enumProperty + " number"); return 0; } |