]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
move storage of ID references from fo/FOInputHandler to fo/FOTreeControl (implemented...
authorWilliam Victor Mote <vmote@apache.org>
Mon, 1 Sep 2003 19:21:07 +0000 (19:21 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Mon, 1 Sep 2003 19:21:07 +0000 (19:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196886 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/apps/Document.java
src/java/org/apache/fop/fo/FOInputHandler.java
src/java/org/apache/fop/fo/FOTreeControl.java
src/java/org/apache/fop/fo/FObj.java

index 39bb24f496e455eeb8801d880c5e17c1779a09fc..caaeee71a4dd3bed70fd4ed9f4cfbf65fffcf074 100644 (file)
@@ -53,6 +53,9 @@ package org.apache.fop.apps;
 // Java
 import java.util.Map;
 import java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+
 
 // FOP
 import org.apache.fop.area.AreaTree;
@@ -102,6 +105,12 @@ public class Document implements FOTreeControl, FOTreeListener {
 
     private Bookmarks bookmarks = null;
 
+    /**
+     * The current set of id's in the FO tree.
+     * This is used so we know if the FO tree contains duplicates.
+     */
+    private Set idReferences = new HashSet();
+
     /**
      * Main constructor
      * @param driver the Driver object that is the "parent" of this Document
@@ -366,5 +375,13 @@ public class Document implements FOTreeControl, FOTreeListener {
         return bookmarks;
     }
 
+    /**
+     * Retuns the set of ID references.
+     * @return the ID references
+     */
+    public Set getIDReferences() {
+        return idReferences;
+    }
+
 }
 
index 4e605e61e680892d7be2efd92320c4c55358aaa7..679ec3fe8784d47633801b3cd61f6457f06e0d96 100644 (file)
  */
 package org.apache.fop.fo;
 
-// Java
-import java.util.Set;
-import java.util.HashSet;
-
 // Avalon
 import org.apache.avalon.framework.logger.AbstractLogEnabled;
 
@@ -86,12 +82,6 @@ import org.xml.sax.SAXException;
  * as our MIF and RTF output targets.
  */
 public abstract class FOInputHandler extends AbstractLogEnabled {
-    /**
-     * The current set of id's in the FO tree.
-     * This is used so we know if the FO tree contains duplicates.
-     */
-    private Set idReferences = new HashSet();
-
     /**
      * The FOTreeControl object that is controlling the FO Tree being built
      */
@@ -106,14 +96,6 @@ public abstract class FOInputHandler extends AbstractLogEnabled {
         this.foTreeControl = foTreeControl;
     }
 
-    /**
-     * Retuns the set of ID references.
-     * @return the ID references
-     */
-    public Set getIDReferences() {
-        return idReferences;
-    }
-
     /**
      * Returns the FontInfo object associated with this FOInputHandler.
      * @return the FontInof object
index 2cf6cbc141a964fd0323281ab76939648829fbdd..a77b6b2a805ee422ae63eb10287c931e9339262a 100644 (file)
@@ -53,6 +53,7 @@ package org.apache.fop.fo;
 
 // Java
 import java.util.Map;
+import java.util.Set;
 
 // FOP
 import org.apache.fop.fo.extensions.Bookmarks;
@@ -107,4 +108,10 @@ public interface FOTreeControl {
      */
     Bookmarks getBookmarks();
 
+    /**
+     * Returns the set of ID references found in the FO Tree.
+     * @return the ID references
+     */
+    Set getIDReferences();
+
 }
index 5cce1eea0dcbbbf14a7cf37449a60f644e984cc2..b1510f2694c28dd450e1a067fe0e33cc2f4c48e8 100644 (file)
@@ -285,7 +285,7 @@ public class FObj extends FONode {
         if (prop != null) {
             String str = prop.getString();
             if (str != null && !str.equals("")) {
-                Set idrefs = foInputHandler.getIDReferences();
+                Set idrefs = getFOTreeControl().getIDReferences();
                 if (!idrefs.contains(str)) {
                     id = str;
                     idrefs.add(id);