aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache
diff options
context:
space:
mode:
authorKaren Lease <klease@apache.org>2001-10-14 20:36:00 +0000
committerKaren Lease <klease@apache.org>2001-10-14 20:36:00 +0000
commit1739edf2369d41550774185f928aae4290df1dfa (patch)
treea4abf19a88fe4a8c652853250df509c869efad6a /src/org/apache
parent172e7a28be4ce53f935acfbbedc001ea8e0b177a (diff)
downloadxmlgraphics-fop-1739edf2369d41550774185f928aae4290df1dfa.tar.gz
xmlgraphics-fop-1739edf2369d41550774185f928aae4290df1dfa.zip
Modify Length to Numeric conversion code
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194505 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache')
-rw-r--r--src/org/apache/fop/fo/LengthProperty.java15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/org/apache/fop/fo/LengthProperty.java b/src/org/apache/fop/fo/LengthProperty.java
index ed1abfa06..8d367c214 100644
--- a/src/org/apache/fop/fo/LengthProperty.java
+++ b/src/org/apache/fop/fo/LengthProperty.java
@@ -8,8 +8,7 @@
package org.apache.fop.fo;
import org.apache.fop.datatypes.Length;
-import org.apache.fop.datatypes.PercentLength;
-import org.apache.fop.datatypes.TableColLength;
+import org.apache.fop.datatypes.AutoLength;
import org.apache.fop.fo.expr.Numeric;
import org.apache.fop.apps.FOPException;
@@ -40,7 +39,7 @@ public class LengthProperty extends Property {
if (isAutoLengthAllowed()) {
String pval = p.getString();
if (pval != null && pval.equals("auto"))
- return new LengthProperty(Length.AUTO);
+ return new LengthProperty(new AutoLength());
}
if (p instanceof LengthProperty)
return p;
@@ -70,15 +69,7 @@ public class LengthProperty extends Property {
}
public Numeric getNumeric() {
- // Can't just do new Numeric(length) because it always uses
- // the constructor for Length!
- // Otherwise, must make each class know about Numeric...
- // ie, return length.asNumeric(): cleaner
- if (length instanceof PercentLength)
- return new Numeric((PercentLength)length);
- if (length instanceof TableColLength)
- return new Numeric((TableColLength)length);
- return new Numeric(length);
+ return length.asNumeric() ;
}
public Length getLength() {