bckfnn 2004/09/07 05:40:44 Modified: src/java/org/apache/fop/fo/properties GenericShorthandParser.java PropertyMaker.java ShorthandParser.java Log: Make the shorthand parser API take a generic property rather than demanding to be passed a ListProperty. Revision Changes Path 1.2 +8 -8 xml-fop/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java Index: GenericShorthandParser.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- GenericShorthandParser.java 6 Sep 2004 21:13:51 -0000 1.1 +++ GenericShorthandParser.java 7 Sep 2004 12:40:43 -0000 1.2 @@ -33,7 +33,7 @@ * @param index the index into the List of properties * @return the property from the List of properties at the index parameter */ - protected Property getElement(ListProperty list, int index) { + protected Property getElement(Property list, int index) { if (list.getList().size() > index) { return (Property) list.getList().elementAt(index); } else { @@ -44,18 +44,18 @@ // Stores 1 to 3 values for border width, style, color // Used for: border, border-top, border-right etc public Property getValueForProperty(int propId, - ListProperty listProperty, + Property property, PropertyMaker maker, PropertyList propertyList) { Property prop = null; // Check for keyword "inherit" - if (listProperty.getList().size() == 1) { - String sval = getElement(listProperty, 0).getString(); + if (property.getList().size() == 1) { + String sval = getElement(property, 0).getString(); if (sval != null && sval.equals("inherit")) { return propertyList.getFromParent(propId); } } - return convertValueForProperty(propId, listProperty, maker, propertyList); + return convertValueForProperty(propId, property, maker, propertyList); } @@ -68,12 +68,12 @@ * @return the Property matching the parameters, or null if not found */ protected Property convertValueForProperty(int propId, - ListProperty listProperty, + Property property, PropertyMaker maker, PropertyList propertyList) { Property prop = null; // Try each of the stored values in turn - Enumeration eprop = listProperty.getList().elements(); + Enumeration eprop = property.getList().elements(); while (eprop.hasMoreElements() && prop == null) { Property p = (Property) eprop.nextElement(); prop = maker.convertShorthandProperty(propertyList, p, null); 1.8 +5 -5 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.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- PropertyMaker.java 7 Sep 2004 12:21:18 -0000 1.7 +++ PropertyMaker.java 7 Sep 2004 12:40:43 -0000 1.8 @@ -601,15 +601,15 @@ if (shorthands == null) { return null; } - ListProperty listprop; + Property prop; int n = shorthands.length; for (int i = 0; i < n && shorthands[i] != null; i++) { PropertyMaker shorthand = shorthands[i]; - listprop = (ListProperty)propertyList.getExplicit(shorthand.propId); - if (listprop != null) { + prop = propertyList.getExplicit(shorthand.propId); + if (prop != null) { ShorthandParser parser = shorthand.datatypeParser; Property p = parser.getValueForProperty(getPropId(), - listprop, this, propertyList); + prop, this, propertyList); if (p != null) { return p; } 1.2 +2 -2 xml-fop/src/java/org/apache/fop/fo/properties/ShorthandParser.java Index: ShorthandParser.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/properties/ShorthandParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ShorthandParser.java 6 Sep 2004 21:13:51 -0000 1.1 +++ ShorthandParser.java 7 Sep 2004 12:40:43 -0000 1.2 @@ -33,7 +33,7 @@ * @return Property object corresponding to propName */ Property getValueForProperty(int propId, - ListProperty listProperty, + Property property, PropertyMaker maker, PropertyList propertyList); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]