]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fixed blatant bugs
authorPeter Bernard West <pbwest@apache.org>
Tue, 18 Jun 2002 05:28:12 +0000 (05:28 +0000)
committerPeter Bernard West <pbwest@apache.org>
Tue, 18 Jun 2002 05:28:12 +0000 (05:28 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@194892 13f79535-47bb-0310-9956-ffa450edef68

src/org/apache/fop/fo/PropertySets.java

index d7688753f7be38002f7a3c36f4e89ec6b027fbfc..204921a3892e333261c185a587baeee05985f2c2 100644 (file)
@@ -677,26 +677,29 @@ public class PropertySets {
     public static PropertyValueList expandAndCopySHand(PropertyValue value)
         throws PropertyException
     {
-        int property;
+        // The property associated with this PropertyValue
+        int property = value.getProperty();
         // Is the property of the argument a shorthand?
-        Integer sHIndex = (Integer)shorthandMap.get
-                (Ints.consts.get(value.getProperty()));
-        if (sHIndex == null)
+        Integer sHIndex =
+                (Integer)(shorthandMap.get(Ints.consts.get(property)));
+        if (sHIndex == null) {
+            String propname = PropNames.getPropertyName(property);
             throw new PropertyException
-                    ("" + value.getProperty() + " not a shorthand property");
-        property = sHIndex.intValue();
-        String sHPropertyName = PropNames.getPropertyName(property);
+                    (propname + " not a shorthand property");
+        }
+
+        // Get the array of indices of the properties in the
+        // expansion of this shorthand
         ROIntArray expansion = shorthandExpansions[property];
         PropertyValueList list = new PropertyValueList(property);
         for (int i = 0; i < expansion.length; i++) {
             int expandedProp = expansion.get(i);
             PropertyValue expandedPropValue;
-
+            //   The PropertyValue must be cloneable
             try {
                 expandedPropValue = (PropertyValue)(value.clone());
             } catch (CloneNotSupportedException e) {
-                throw new PropertyException
-                        (sHPropertyName + ": " + e.getMessage());
+                throw new PropertyException(e.getMessage());
             }
 
             expandedPropValue.setProperty(expandedProp);