From 8384a7fb718ade0bb485ce7bb1caed81ac2a4f62 Mon Sep 17 00:00:00 2001 From: Karen Lease Date: Sun, 4 Mar 2001 21:29:46 +0000 Subject: Support for border-related shorthand properties and PropertyManager delegate object git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194124 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/fo/FObj.java | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/org/apache/fop/fo/FObj.java') diff --git a/src/org/apache/fop/fo/FObj.java b/src/org/apache/fop/fo/FObj.java index 2011ef140..053758b11 100644 --- a/src/org/apache/fop/fo/FObj.java +++ b/src/org/apache/fop/fo/FObj.java @@ -78,17 +78,23 @@ public class FObj extends FONode { // protected PropertyList properties; public PropertyList properties; + protected PropertyManager propMgr; protected String name; protected FObj(FObj parent, PropertyList propertyList) { super(parent); - this.properties = propertyList; + this.properties = propertyList; // TO BE REMOVED!!! propertyList.setFObj(this); + this.propMgr = makePropertyManager(propertyList); this.name = "default FO"; setWritingMode(); } + protected PropertyManager makePropertyManager(PropertyList propertyList) { + return new PropertyManager(propertyList); + } + /** * adds characters (does nothing here) * @param data text @@ -187,17 +193,15 @@ public class FObj extends FONode { * Set writing mode for this FO. * Find nearest ancestor, including self, which generates * reference areas and use the value of its writing-mode property. + * If no such ancestor is found, use the value on the root FO. */ private void setWritingMode() { - FObj p = this; - while (p!= null && !p.generatesReferenceAreas()) - p = p.getParent(); - if (p != null) { - this.properties.setWritingMode(p.getProperty("writing-mode").getEnum()); - } - else { - // shouldn't happen!!! - } + FObj p ; + FObj parent; + for (p=this; + !p.generatesReferenceAreas() && (parent = p.getParent()) != null; + p=parent); + this.properties.setWritingMode(p.getProperty("writing-mode").getEnum()); } -- cgit v1.2.3