bckfnn 2004/10/19 05:57:33 Modified: src/java/org/apache/fop/fo/properties PropertyMaker.java Log: Second phase of performance improvement. - Let PropertyList deal with caching issues. - Don't use compound property ids. PR: 31699 Revision Changes Path 1.9 +19 -21 xml-fop/src/java/org/apache/fop/fo/properties/PropertyMaker.java Index: PropertyMaker.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/PropertyMaker.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- PropertyMaker.java 7 Sep 2004 12:40:43 -0000 1.8 +++ PropertyMaker.java 19 Oct 2004 12:57:33 -0000 1.9 @@ -25,6 +25,7 @@ import org.apache.fop.datatypes.CompoundDatatype; import org.apache.fop.datatypes.LengthBase; import org.apache.fop.datatypes.PercentBase; +import org.apache.fop.fo.Constants; import org.apache.fop.fo.FOPropertyMapping; import org.apache.fop.fo.FObj; import org.apache.fop.fo.PropertyList; @@ -238,14 +239,16 @@ { Property p = null; - log.trace("PropertyMaker.findProperty: " + if (log.isTraceEnabled()) { + log.trace("PropertyMaker.findProperty: " + FOPropertyMapping.getPropertyName(propId) + ", " + propertyList.getFObj().getName()); + } if (corresponding != null && corresponding.isCorrespondingForced(propertyList)) { p = corresponding.compute(propertyList); } else { - p = propertyList.getExplicitBaseProp(propId); + p = propertyList.getExplicit(propId); if (p == null) { p = this.compute(propertyList); } @@ -256,12 +259,7 @@ // else inherit (if has parent and is inheritable) PropertyList parentPropertyList = propertyList.getParentPropertyList(); if (parentPropertyList != null && isInherited()) { - if (!contextDep) { - // use the cache - p = parentPropertyList.findProperty(propId, this); - } else { - p = findProperty(parentPropertyList, bTryInherit); - } + p = parentPropertyList.get(propId, true, false); } } } @@ -283,14 +281,7 @@ boolean bTryInherit, boolean bTryDefault) throws FOPException { - Property p; - - if (!contextDep && bTryInherit) { - // use the cache - p = propertyList.findProperty(propId, this); - } else { - p = findProperty(propertyList, bTryInherit); - } + Property p = findProperty(propertyList, bTryInherit); if (p == null && bTryDefault) { // default value for this FO! try { @@ -376,13 +367,17 @@ */ public Property make(PropertyList propertyList) throws FOPException { if (defaultProperty != null) { - log.trace("PropertyMaker.make: reusing defaultProperty, " - + FOPropertyMapping.getPropertyName(propId)); + if (log.isTraceEnabled()) { + log.trace("PropertyMaker.make: reusing defaultProperty, " + + FOPropertyMapping.getPropertyName(propId)); + } return defaultProperty; } - log.trace("PropertyMaker.make: making default property value, " + if (log.isTraceEnabled()) { + log.trace("PropertyMaker.make: making default property value, " + FOPropertyMapping.getPropertyName(propId) + ", " + propertyList.getFObj().getName()); + } Property p = make(propertyList, defaultValue, propertyList.getParentFObj()); if (!contextDep) { defaultProperty = p; @@ -404,7 +399,10 @@ Property newProp = null; String pvalue = value; if ("inherit".equals(value)) { - newProp = propertyList.getFromParent(this.propId); + newProp = propertyList.getFromParent(this.propId & Constants.PROPERTY_MASK); + if ((propId & Constants.COMPOUND_MASK) != 0) { + newProp = getSubprop(newProp, propId & Constants.COMPOUND_MASK); + } } else { newProp = checkEnumValues(value); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]