aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-05-01 09:02:17 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-05-01 09:02:17 +0000
commitb0aa6451cff09798e724e0435a0e839739a263ac (patch)
treecbc5b177041b9ba5f50537846118e718ec125ff1 /src
parent5516c22f7ca791b7a52963e94bf529d19d6e584d (diff)
downloadxmlgraphics-fop-b0aa6451cff09798e724e0435a0e839739a263ac.tar.gz
xmlgraphics-fop-b0aa6451cff09798e724e0435a0e839739a263ac.zip
Refactor: rename and cleanup findBaseProperty().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196386 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/java/org/apache/fop/fo/PropertyListBuilder.java50
1 files changed, 26 insertions, 24 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyListBuilder.java b/src/java/org/apache/fop/fo/PropertyListBuilder.java
index 33da6d242..c8feeae81 100644
--- a/src/java/org/apache/fop/fo/PropertyListBuilder.java
+++ b/src/java/org/apache/fop/fo/PropertyListBuilder.java
@@ -188,10 +188,10 @@ public class PropertyListBuilder {
PropertyList propList,
FObj parentFO) {
/* Handle "compound" properties, ex. space-before.minimum */
- String basePropName = findBasePropertyName(attributeName);
- String subPropName = findSubPropertyName(attributeName);
+ String basePropertyName = findBasePropertyName(attributeName);
+ String subPropertyName = findSubPropertyName(attributeName);
- Property.Maker propertyMaker = findMaker(validProperties, basePropName);
+ Property.Maker propertyMaker = findMaker(validProperties, basePropertyName);
if (propertyMaker == null) {
handleInvalidProperty(attributeName);
return;
@@ -201,14 +201,17 @@ public class PropertyListBuilder {
}
try {
Property prop = null;
- if (subPropName == null) {
+ if (subPropertyName == null) {
prop = propertyMaker.make(propList, attributeValue, parentFO);
}
else {
- prop = findSubPropValue(attributes, propList, parentFO, basePropName, subPropName, prop, propertyMaker, attributeValue);
+ Property baseProperty = findBaseProperty(attributes, propList,
+ parentFO, basePropertyName, propertyMaker);
+ prop = propertyMaker.make(baseProperty, subPropertyName,
+ propList, attributeValue, parentFO);
}
if (prop != null) {
- propList.put(basePropName, prop);
+ propList.put(basePropertyName, prop);
}
}
catch (FOPException e) {
@@ -217,28 +220,27 @@ public class PropertyListBuilder {
}
}
- private Property findSubPropValue(Attributes attributes,
- PropertyList p,
+ private Property findBaseProperty(Attributes attributes,
+ PropertyList propertyList,
FObj parentFO,
String basePropName,
- String subPropName,
- Property propVal,
- Maker propertyMaker,
- String attributeValue)
+ Maker propertyMaker)
throws FOPException {
- Property baseProp = p.getExplicitBaseProp(basePropName);
- if (baseProp == null) {
- // See if it is specified later in this list
- String baseValue = attributes.getValue(basePropName);
- if (baseValue != null) {
- baseProp = propertyMaker.make(p, baseValue,
- parentFO);
- }
- // else baseProp = propertyMaker.makeCompound(p, parentFO);
+ // If the baseProperty has already been created, return it
+ Property baseProperty = propertyList.getExplicitBaseProp(basePropName);
+ if (baseProperty != null) {
+ return baseProperty;
+ }
+ // If it is specified later in this list of Attributes, create it
+ String basePropertyValue = attributes.getValue(basePropName);
+ if (basePropertyValue != null) {
+ baseProperty = propertyMaker.make(propertyList, basePropertyValue,
+ parentFO);
+ return baseProperty;
}
- propVal = propertyMaker.make(baseProp, subPropName, p, attributeValue,
- parentFO);
- return propVal;
+ // Otherwise it is a compound property ??
+ // baseProperty = propertyMaker.makeCompound(propertyList, parentFO);
+ return baseProperty;
}
private void handleInvalidProperty(String attributeName) {