From 29bb02aa9f36915eeee86e8fc596c6135c2b72ef Mon Sep 17 00:00:00 2001 From: Glen Mazza Date: Wed, 13 Oct 2004 00:31:46 +0000 Subject: [PATCH] PR: Obtained from: Submitted by: Reviewed by: Some simplifications allowed as a result of having FOText extend FONode directly. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198042 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FOText.java | 10 +----- src/java/org/apache/fop/fo/FObj.java | 35 +++++-------------- src/java/org/apache/fop/fo/FObjMixed.java | 3 +- .../fop/layoutmgr/AbstractLayoutManager.java | 2 +- 4 files changed, 12 insertions(+), 38 deletions(-) diff --git a/src/java/org/apache/fop/fo/FOText.java b/src/java/org/apache/fop/fo/FOText.java index 4bdc0c5b4..3c4f70b29 100644 --- a/src/java/org/apache/fop/fo/FOText.java +++ b/src/java/org/apache/fop/fo/FOText.java @@ -28,7 +28,7 @@ import org.apache.fop.fo.pagination.Root; import org.apache.fop.layoutmgr.TextLayoutManager; /** - * A text node in the formatting object tree. + * A text node (PCDATA) in the formatting object tree. * * Unfortunately the BufferManager implementatation holds * onto references to the character data in this object @@ -488,14 +488,6 @@ public class FOText extends FONode { } - /** - * @todo rename somehow, there isn't an fo:text. - * @todo see if should still be a subclass of FObj - */ - public String getName() { - return "fo:text"; - } - /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java index 86d171792..1f6b4dd5a 100644 --- a/src/java/org/apache/fop/fo/FObj.java +++ b/src/java/org/apache/fop/fo/FObj.java @@ -54,9 +54,6 @@ public class FObj extends FONode implements Constants { */ private boolean isOutOfLineFODescendant = false; - /** Id of this fo element or null if no id. */ - protected String id = null; - /** Markers added to this element. */ protected Map markers = null; @@ -135,19 +132,15 @@ public class FObj extends FONode implements Constants { * fo and sets the id attribute of this object. */ private void setupID() throws SAXParseException { - Property prop = this.propertyList.get(PR_ID); - if (prop != null) { - String str = prop.getString(); - if (str != null && !str.equals("")) { - Set idrefs = getFOEventHandler().getIDReferences(); - if (!idrefs.contains(str)) { - id = str; - idrefs.add(id); - } else { - throw new SAXParseException("Property id \"" + str + - "\" previously used; id values must be unique" + - " in document.", locator); - } + String str = getPropString(PR_ID); + if (str != null && !str.equals("")) { + Set idrefs = getFOEventHandler().getIDReferences(); + if (!idrefs.contains(str)) { + idrefs.add(str); + } else { + throw new SAXParseException("Property id \"" + str + + "\" previously used; id values must be unique" + + " in document.", locator); } } } @@ -349,16 +342,6 @@ public class FObj extends FONode implements Constants { return new Integer(0); } - /** - * Get the id string for this formatting object. - * This will be unique for the fo document. - * - * @return the id string or null if not set - */ - public String getID() { - return id; - } - /** * Check if this formatting object generates reference areas. * @return true if generates reference areas diff --git a/src/java/org/apache/fop/fo/FObjMixed.java b/src/java/org/apache/fop/fo/FObjMixed.java index 5c72cbc6b..bd3c7e2e9 100644 --- a/src/java/org/apache/fop/fo/FObjMixed.java +++ b/src/java/org/apache/fop/fo/FObjMixed.java @@ -25,8 +25,7 @@ import org.apache.fop.layoutmgr.InlineStackingLayoutManager; /** * Base class for representation of mixed content formatting objects - * and their processing - * @todo define what a "mixed content formatting object" is + * (i.e., those that can contain both child FO's and text nodes/PCDATA) */ public class FObjMixed extends FObj { /** TextInfo for this object */ diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java index d8a624e1d..1770bc196 100644 --- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java @@ -86,7 +86,7 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants */ public void setFObj(FObj fo) { this.fobj = fo; - foID = fobj.getID(); + foID = fobj.getPropString(PR_ID); markers = fobj.getMarkers(); fobjIter = fobj.getChildNodes(); childLMiter = new LMiter(this); -- 2.39.5