From cc20e916526085d34f300e31206abd9fad269cdb Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Fri, 9 Jan 2004 22:32:27 +0000 Subject: [PATCH] Bug 25810 (Patch by Finn Bock) -- Support for inherit attribute value. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197151 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/Property.java | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/java/org/apache/fop/fo/Property.java b/src/java/org/apache/fop/fo/Property.java index 11c12205a..700615e67 100644 --- a/src/java/org/apache/fop/fo/Property.java +++ b/src/java/org/apache/fop/fo/Property.java @@ -234,26 +234,30 @@ public class Property { public Property make(PropertyList propertyList, String value, FObj fo) throws FOPException { try { - Property pret = null; + Property newProp = null; String pvalue = value; - pret = checkEnumValues(value); - if (pret == null) { + if ("inherit".equals(value)) { + newProp = propertyList.getFromParent(this.propId); + } else { + newProp = checkEnumValues(value); + } + if (newProp == null) { /* Check for keyword shorthand values to be substituted. */ pvalue = checkValueKeywords(value); // Override parsePropertyValue in each subclass of Property.Maker Property p = PropertyParser.parse(pvalue, new PropertyInfo(this, propertyList, fo)); - pret = convertProperty(p, propertyList, fo); + newProp = convertProperty(p, propertyList, fo); } else if (isCompoundMaker()) { - pret = convertProperty(pret, propertyList, fo); + newProp = convertProperty(newProp, propertyList, fo); } - if (pret == null) { + if (newProp == null) { throw new org.apache.fop.fo.expr.PropertyException("No conversion defined"); } else if (inheritsSpecified()) { - pret.setSpecifiedValue(pvalue); + newProp.setSpecifiedValue(pvalue); } - return pret; + return newProp; } catch (org.apache.fop.fo.expr.PropertyException propEx) { String propName = FOPropertyMapping.getPropertyName(this.propId); throw new FOPException("Error in " + propName -- 2.39.5