]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Third phase of performance improvement.
authorFinn Bock <bckfnn@apache.org>
Tue, 19 Oct 2004 18:42:43 +0000 (18:42 +0000)
committerFinn Bock <bckfnn@apache.org>
Tue, 19 Oct 2004 18:42:43 +0000 (18:42 +0000)
- 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

src/java/org/apache/fop/fo/FOPropertyMapping.java
src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java

index 25155c8649b585ccb713c44b70c18a0d113e04b2..30aa0fa391aa4884c0f1989dd038a06eb161cfe5 100644 (file)
@@ -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");
index 10c65abe3ab54aea4853c2ccf12c9b970655606a..7a12e0bdcbc9e6801c708ae2518e0637b0b22fbb 100644 (file)
 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);
     }
+    */
 }