]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
switch from Property.getPropName() to Property.getPropId(); comments added to
authorGlen Mazza <gmazza@apache.org>
Sat, 10 Jan 2004 20:40:07 +0000 (20:40 +0000)
committerGlen Mazza <gmazza@apache.org>
Sat, 10 Jan 2004 20:40:07 +0000 (20:40 +0000)
PropertySets.java to clarify makeSparseIndices() method.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197156 13f79535-47bb-0310-9956-ffa450edef68

src/codegen/properties.xsl
src/java/org/apache/fop/datatypes/ToBeImplementedProperty.java
src/java/org/apache/fop/fo/Property.java
src/java/org/apache/fop/fo/PropertySets.java

index 1c3a6fd98ffd1610b15e05893050e0c34879a9d8..c2e00f1a546c2d60c023e3347cce27beaf5504f9 100644 (file)
@@ -883,7 +883,7 @@ public class </xsl:text>
     <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>
index 97717ca0656410a6f05c186c3a3babc67bc5279f..73997c2281401eb83910848f31d5750a91b4e111 100644 (file)
@@ -69,7 +69,7 @@ public class ToBeImplementedProperty extends Property {
             }
 
             ToBeImplementedProperty val =
-                new ToBeImplementedProperty(getPropName());
+                new ToBeImplementedProperty(getPropId());
             return val;
         }
     }
index 700615e67030f58dc4320696256ba9b2e8298381..bc8946c8371a295702cb20601a9621ecef0984c4 100644 (file)
@@ -81,7 +81,7 @@ public class Property {
         /**
          * @return the name of the property for this Maker
          */
-        protected int getPropName() {
+        protected int getPropId() {
             return propId;
         }
 
index bdcb1f06d980b871a122e5e29d78479a39568325..8eb39adfbd2c3e51d2a5edd11b7c16c5960268c4 100644 (file)
@@ -1267,13 +1267,27 @@ public class PropertySets {
 
     }
 
+   /*  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;
     }