aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlen Mazza <gmazza@apache.org>2004-01-02 22:37:09 +0000
committerGlen Mazza <gmazza@apache.org>2004-01-02 22:37:09 +0000
commit72a52419d4cdfc0aac1ddfceff46f88f40ae7ec6 (patch)
tree7749eb55daa247aab550fb4d49b8dfe358380d52
parent76776942369fb85eb6070fcbec3c5786d1bf9d14 (diff)
downloadxmlgraphics-fop-72a52419d4cdfc0aac1ddfceff46f88f40ae7ec6.tar.gz
xmlgraphics-fop-72a52419d4cdfc0aac1ddfceff46f88f40ae7ec6.zip
Bug 25803 (patch by Simon Pepping): Fix bug occurring when a compound property
is specified (e.g. "leader-length.maximum") before its base property (e.g. "leader-length"). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197095 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fo/PropertyList.java32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java
index adb88617f..02023b9f2 100644
--- a/src/java/org/apache/fop/fo/PropertyList.java
+++ b/src/java/org/apache/fop/fo/PropertyList.java
@@ -216,7 +216,7 @@ public class PropertyList extends HashMap {
* @return The value if the property is explicitly set, otherwise null.
*/
public Property getExplicitBaseProp(String propertyName) {
- return (Property)super.get(propertyName);
+ return (Property) super.get(propertyName);
}
/**
@@ -516,9 +516,18 @@ public class PropertyList extends HashMap {
}
try {
Property prop = null;
- if (subPropertyName == null) {
+ if (subPropertyName == null) { // base attribute only found
+ /* Do nothing if the base property has already been created.
+ * This is e.g. the case when a compound attribute was
+ * specified before the base attribute; in these cases
+ * the base attribute was already created in
+ * findBaseProperty()
+ */
+ if (getExplicitBaseProp(basePropertyName) != null) {
+ return;
+ }
prop = propertyMaker.make(this, attributeValue, parentFO);
- } else {
+ } else { // e.g. "leader-length.maximum"
Property baseProperty = findBaseProperty(attributes,
parentFO, basePropertyName, propertyMaker);
prop = propertyMaker.make(baseProperty, subPropertyName,
@@ -538,25 +547,30 @@ public class PropertyList extends HashMap {
String basePropName,
Maker propertyMaker)
throws FOPException {
- // If the baseProperty has already been created, return it
+
+ /* If the baseProperty has already been created, return it
+ * e.g. <fo:leader xxxx="120pt" xxxx.maximum="200pt"... />
+ */
Property baseProperty = getExplicitBaseProp(basePropName);
if (baseProperty != null) {
return baseProperty;
}
- // If it is specified later in this list of Attributes, create it
+
+ /* Otherwise If it is specified later in this list of Attributes, create it now
+ * e.g. <fo:leader xxxx.maximum="200pt" xxxx="200pt"... />
+ */
String basePropertyValue = attributes.getValue(basePropName);
if (basePropertyValue != null) {
- int propertyId = FOPropertyMapping.getPropertyId(basePropertyValue);
+ int propertyId = FOPropertyMapping.getPropertyId(basePropName);
if (propertyId != -1) {
baseProperty = propertyMaker.make(this, basePropertyValue,
parentFO);
return baseProperty;
}
}
- // Otherwise it is a compound property ??
- // baseProperty = propertyMaker.makeCompound(propertyList, parentFO);
- return baseProperty;
+
+ return null; // could not find base property
}
private void handleInvalidProperty(String attributeName) {