]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bug 25810 (Patch by Finn Bock) -- Support for inherit attribute value.
authorGlen Mazza <gmazza@apache.org>
Fri, 9 Jan 2004 22:32:27 +0000 (22:32 +0000)
committerGlen Mazza <gmazza@apache.org>
Fri, 9 Jan 2004 22:32:27 +0000 (22:32 +0000)
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

index 11c12205a15bf4904cab7167d5237846d0f6b260..700615e67030f58dc4320696256ba9b2e8298381 100644 (file)
@@ -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