aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorFinn Bock <bckfnn@apache.org>2004-09-07 12:40:43 +0000
committerFinn Bock <bckfnn@apache.org>2004-09-07 12:40:43 +0000
commiteb38e93dfd62bb6d79e39ec38be59c79658c1838 (patch)
treed224d88ef5deec524e05bd21e93858ebfc2785fa /src/java/org/apache/fop
parent369762b15f76a508ee0bcf7ba236af9b7ff4c5a4 (diff)
downloadxmlgraphics-fop-eb38e93dfd62bb6d79e39ec38be59c79658c1838.tar.gz
xmlgraphics-fop-eb38e93dfd62bb6d79e39ec38be59c79658c1838.zip
Make the shorthand parser API take a generic property rather than
demanding to be passed a ListProperty. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197924 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/fo/properties/GenericShorthandParser.java14
-rw-r--r--src/java/org/apache/fop/fo/properties/PropertyMaker.java8
-rw-r--r--src/java/org/apache/fop/fo/properties/ShorthandParser.java2
3 files changed, 12 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
index 54be52421..c8b92f642 100644
--- a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
@@ -33,7 +33,7 @@ public class GenericShorthandParser implements ShorthandParser {
* @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 @@ public class GenericShorthandParser implements ShorthandParser {
// 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 @@ public class GenericShorthandParser implements ShorthandParser {
* @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);
diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
index 19048f9d7..a9d4a8e6b 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
@@ -601,15 +601,15 @@ public class PropertyMaker implements Cloneable {
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;
}
diff --git a/src/java/org/apache/fop/fo/properties/ShorthandParser.java b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
index b8045b759..0d6b7b09a 100644
--- a/src/java/org/apache/fop/fo/properties/ShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
@@ -33,7 +33,7 @@ public interface ShorthandParser {
* @return Property object corresponding to propName
*/
Property getValueForProperty(int propId,
- ListProperty listProperty,
+ Property property,
PropertyMaker maker,
PropertyList propertyList);
}