aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-10-19 18:42:43 +0000
committerFinn Bock <bckfnn@apache.org>2004-10-19 18:42:43 +0000
commit99602d2f4ad5926b0b3c2ffa3bb7c9c8f88373d2 (patch)
treed1b4daa0836e07655b867a19a6b21cc8dc769192 /src/java/org/apache/fop
parentc34e500124d950dac4d5deb7fe435b6e4c2c4613 (diff)
downloadxmlgraphics-fop-99602d2f4ad5926b0b3c2ffa3bb7c9c8f88373d2.tar.gz
xmlgraphics-fop-99602d2f4ad5926b0b3c2ffa3bb7c9c8f88373d2.zip
Third phase of performance improvement.
- Make line-height a SpaceProperty instead of a LengthProperty. PR: 31699 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198066 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/fo/FOPropertyMapping.java1
-rw-r--r--src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java22
2 files changed, 21 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/fo/FOPropertyMapping.java b/src/java/org/apache/fop/fo/FOPropertyMapping.java
index 25155c864..30aa0fa39 100644
--- a/src/java/org/apache/fop/fo/FOPropertyMapping.java
+++ b/src/java/org/apache/fop/fo/FOPropertyMapping.java
@@ -1481,6 +1481,7 @@ public class FOPropertyMapping implements Constants {
// line-height
m = new LineHeightPropertyMaker(PR_LINE_HEIGHT);
+ m.useGeneric(genericSpace);
m.setInherited(true);
m.setDefault("normal", true);
m.addKeyword("normal", "1.2em");
diff --git a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
index 10c65abe3..7a12e0bdc 100644
--- a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
@@ -19,8 +19,10 @@
package org.apache.fop.fo.properties;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
+import org.apache.fop.fo.expr.PropertyException;
/**
* A maker which calculates the line-height property.
@@ -31,7 +33,7 @@ import org.apache.fop.fo.PropertyList;
* the nearest specified is used to recalculate the line-height.
*/
-public class LineHeightPropertyMaker extends LengthProperty.Maker {
+public class LineHeightPropertyMaker extends SpaceProperty.Maker {
/**
* Create a maker for line-height.
* @param propId the is for linehight.
@@ -76,7 +78,22 @@ public class LineHeightPropertyMaker extends LengthProperty.Maker {
}
return null;
}
-
+
+ public Property convertProperty(Property p,
+ PropertyList propertyList,
+ FObj fo) throws FOPException {
+ Numeric numval = p.getNumeric();
+ if (numval != null && numval.getDimension() == 0) {
+ try {
+ p = new PercentLength(numval.getNumericValue(), getPercentBase(fo,propertyList));
+ } catch (PropertyException exc) {
+ // log.error("exception", exc);
+ }
+ }
+ return super.convertProperty(p, propertyList, fo);
+ }
+
+ /*
protected Property convertPropertyDatatype(Property p,
PropertyList propertyList,
FObj fo) {
@@ -86,4 +103,5 @@ public class LineHeightPropertyMaker extends LengthProperty.Maker {
}
return super.convertPropertyDatatype(p, propertyList, fo);
}
+ */
}