gmazza 2004/01/10 12:40:07 Modified: src/codegen properties.xsl src/java/org/apache/fop/datatypes ToBeImplementedProperty.java src/java/org/apache/fop/fo Property.java PropertySets.java Log: switch from Property.getPropName() to Property.getPropId(); comments added to PropertySets.java to clarify makeSparseIndices() method. Revision Changes Path 1.31 +2 -2 xml-fop/src/codegen/properties.xsl Index: properties.xsl =================================================================== RCS file: /home/cvs/xml-fop/src/codegen/properties.xsl,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- properties.xsl 9 Jan 2004 03:05:55 -0000 1.30 +++ properties.xsl 10 Jan 2004 20:40:07 -0000 1.31 @@ -883,7 +883,7 @@ <xsl:value-of select="key('shorthandref', $shprop)/datatype-parser"/> <xsl:text>(listprop); p = shparser.getValueForProperty( - getPropName(), this, propertyList); + getPropId(), this, propertyList); } }</xsl:text> </xsl:for-each> 1.5 +1 -1 xml-fop/src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java Index: ToBeImplementedProperty.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ToBeImplementedProperty.java 26 Dec 2003 23:41:47 -0000 1.4 +++ ToBeImplementedProperty.java 10 Jan 2004 20:40:07 -0000 1.5 @@ -69,7 +69,7 @@ } ToBeImplementedProperty val = - new ToBeImplementedProperty(getPropName()); + new ToBeImplementedProperty(getPropId()); return val; } } 1.15 +1 -1 xml-fop/src/java/org/apache/fop/fo/Property.java Index: Property.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Property.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- Property.java 9 Jan 2004 22:32:27 -0000 1.14 +++ Property.java 10 Jan 2004 20:40:07 -0000 1.15 @@ -81,7 +81,7 @@ /** * @return the name of the property for this Maker */ - protected int getPropName() { + protected int getPropId() { return propId; } 1.3 +18 -4 xml-fop/src/java/org/apache/fop/fo/PropertySets.java Index: PropertySets.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertySets.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PropertySets.java 22 Dec 2003 23:23:05 -0000 1.2 +++ PropertySets.java 10 Jan 2004 20:40:07 -0000 1.3 @@ -1267,13 +1267,27 @@ } + /* These arrays, one for each formatting object, define the properties that + * are valid for an FO and its children. The first element, indices[0], + * will be used in PropertyList to define the size of the Property[] array + * for the FObj (= the number of properties valid for the element + 1.) + * Each other element of this array has a value of 0 if not supported by the FO, + * 1-based index otherwise. This array will be used as a pointer to the Property[] + * array in PropertyList holding the valid properties for the FO. + * i.e., fo.propList.values[indices[propId]] will refer to the correct Property + * element if the property is valid for the FO, values[indices[invalPropId]] = + * values[0] = NULL otherwise. + */ private static short[] makeSparseIndices(BitSet set) { - short[] indices = new short[Constants.PROPERTY_COUNT]; + short[] indices = new short[Constants.PROPERTY_COUNT +1]; + indices[0] = (short) (set.cardinality() + 1); - int j = 1; + + int propIndex = 1; for (int i = set.nextSetBit(0); i >= 0; i = set.nextSetBit(i+1)) { - indices[i] = (short) j++; + indices[i] = (short) propIndex++; } + return indices; }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]