bckfnn      2004/10/19 11:42:43

  Modified:    src/java/org/apache/fop/fo/properties
                        LineHeightPropertyMaker.java
               src/java/org/apache/fop/fo FOPropertyMapping.java
  Log:
  Third phase of performance improvement.
  - Make line-height a SpaceProperty instead of a LengthProperty.
  
  PR: 31699
  
  Revision  Changes    Path
  1.6       +21 -3     
xml-fop/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
  
  Index: LineHeightPropertyMaker.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LineHeightPropertyMaker.java      27 Feb 2004 17:45:45 -0000      1.5
  +++ LineHeightPropertyMaker.java      19 Oct 2004 18:42:43 -0000      1.6
  @@ -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 @@
    * 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 @@
           }
           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 @@
           }
           return super.convertPropertyDatatype(p, propertyList, fo);
       }
  +    */
   }
  
  
  
  1.28      +2 -1      xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java
  
  Index: FOPropertyMapping.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FOPropertyMapping.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FOPropertyMapping.java    10 Oct 2004 21:12:06 -0000      1.27
  +++ FOPropertyMapping.java    19 Oct 2004 18:42:43 -0000      1.28
  @@ -1481,6 +1481,7 @@
   
           // line-height
           m  = new LineHeightPropertyMaker(PR_LINE_HEIGHT);
  +        m.useGeneric(genericSpace);
           m.setInherited(true);
           m.setDefault("normal", true);
           m.addKeyword("normal", "1.2em");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to