You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-commits@xmlgraphics.apache.org by ca...@apache.org on 2007/09/26 05:13:43 UTC

svn commit: r579438 - /xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java

Author: cam
Date: Tue Sep 25 20:13:42 2007
New Revision: 579438

URL: http://svn.apache.org/viewvc?rev=579438&view=rev
Log:
Remove event listeners when <text> elements are removed from the document.
Fixes bug 41988.

Modified:
    xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java

Modified: xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java?rev=579438&r1=579437&r2=579438&view=diff
==============================================================================
--- xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java (original)
+++ xmlgraphics/batik/trunk/sources/org/apache/batik/bridge/SVGTextElementBridge.java Tue Sep 25 20:13:42 2007
@@ -446,6 +446,15 @@
     }
 
     /**
+     * Disposes this text element bridge by removing the text event listeners
+     * that were added in {@link #initializeDynamicSupport}.
+     */
+    public void dispose() {
+        removeTextEventListeners(ctx, (NodeEventTarget) e);
+        super.dispose();
+    }
+
+    /**
      * Add to the element children of the node, a
      * <code>SVGContext</code> to support dynamic update. This is
      * recursive, the children of the nodes are also traversed to add
@@ -512,14 +521,6 @@
     /**
      * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
      */
-    public void handleDOMNodeRemovedEvent(MutationEvent evt) {
-        removeTextEventListeners(ctx, (NodeEventTarget) evt.getTarget());
-        super.handleDOMNodeRemovedEvent(evt);
-    }
-
-    /**
-     * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
-     */
     public void handleDOMChildNodeRemovedEvent(MutationEvent evt) {
         Node childNode = (Node)evt.getTarget();
 
@@ -2135,8 +2136,7 @@
          * Invoked when an MutationEvent of type 'DOMNodeRemoved' is fired.
          */
         public void handleDOMNodeRemovedEvent(MutationEvent evt) {
-            //nothing to do
-            dispose();
+            textBridge.handleDOMNodeRemovedEvent(evt);
         }
 
         /**