From: William Victor Mote Date: Thu, 1 May 2003 04:42:43 +0000 (+0000) Subject: Refactor: Extract method FObj.getPropertiesForNamespace() from PropertyListBuilder... X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1504 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee2b8152997a5c17e158624755c421a53301c82d;p=xmlgraphics-fop.git Refactor: Extract method FObj.getPropertiesForNamespace() from PropertyListBuilder.makeList(). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196381 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 650d8c7d8..9caf7af97 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -172,6 +172,16 @@ public class FObj extends FONode { return (FObj)par; } + public PropertyList getPropertiesForNamespace(String nameSpaceURI) { + if (this.properties == null) { + return null; + } + if (! nameSpaceURI.equals(this.properties.getNameSpace())) { + return null; + } + return this.properties; + } + protected PropertyManager makePropertyManager( PropertyList propertyList) { return new PropertyManager(propertyList); diff --git a/src/java/org/apache/fop/fo/PropertyListBuilder.java b/src/java/org/apache/fop/fo/PropertyListBuilder.java index e0addaed5..2c49f2e6e 100644 --- a/src/java/org/apache/fop/fo/PropertyListBuilder.java +++ b/src/java/org/apache/fop/fo/PropertyListBuilder.java @@ -138,18 +138,12 @@ public class PropertyListBuilder { nameSpaceURIToUse = nameSpaceURI; } FObj parentFO = fo.findNearestAncestorFObj(); - - PropertyList parentPropertyList = null; + PropertyList parentProperties = null; if (parentFO != null) { - parentPropertyList = parentFO.properties; - } - PropertyList par = null; - if (parentPropertyList != null - && nameSpaceURIToUse.equals(parentPropertyList.getNameSpace())) { - par = parentPropertyList; + parentProperties = parentFO.getPropertiesForNamespace(nameSpaceURIToUse); } - PropertyList p = new PropertyList(par, nameSpaceURIToUse, + PropertyList p = new PropertyList(parentProperties, nameSpaceURIToUse, elementName); p.setBuilder(this); HashMap table;