gmazza 2004/01/13 15:28:31 Modified: src/java/org/apache/fop/fo PropertyList.java Log: static boolean array inheritableProperty[] added, to reduce processing costs of lookups to see if a property is inheritable. Work based on Finn Bock's patch. Revision Changes Path 1.25 +10 -7 xml-fop/src/java/org/apache/fop/fo/PropertyList.java Index: PropertyList.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertyList.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- PropertyList.java 9 Jan 2004 03:05:55 -0000 1.24 +++ PropertyList.java 13 Jan 2004 23:28:31 -0000 1.25 @@ -69,6 +69,7 @@ // writing-mode values private byte[] wmtable = null; private int writingMode; + private static boolean[] inheritableProperty; // absolute directions and dimensions /** constant for direction "left" */ @@ -678,14 +679,16 @@ * @return isInherited value from the requested Property.Maker */ private boolean isInherited(int propId) { - boolean b = true; - - Property.Maker propertyMaker = findMaker(propId); - if (propertyMaker != null) { - b = propertyMaker.isInherited(); + if (inheritableProperty == null) { + inheritableProperty = new boolean[Constants.PROPERTY_COUNT + 1]; + Property.Maker maker = null; + for (int prop = 1; prop <= Constants.PROPERTY_COUNT; prop++) { + maker = findMaker(prop); + inheritableProperty[prop] = (maker != null && maker.isInherited()); + } } - - return b; + + return inheritableProperty[propId]; } /**
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]