Author: mrglavas
Date: Thu Aug 31 21:45:24 2006
New Revision: 439176

URL: http://svn.apache.org/viewvc?rev=439176&view=rev
Log:
Call UserDataHandlers registered on the HTMLDocument node. In order to make this
work the visibility of callUserDataHandlers() in CoreDocumentImpl was changed 
to 
protected (which just happens to satisfy a request made by Jacob Kjome on the
j-users mailing list).

Modified:
    xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java
    xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java

Modified: xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java?rev=439176&r1=439175&r2=439176&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java (original)
+++ xerces/java/trunk/src/org/apache/html/dom/HTMLDocumentImpl.java Thu Aug 31 
21:45:24 2006
@@ -13,6 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.html.dom;
 
 import java.io.StringWriter;
@@ -26,6 +27,7 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.w3c.dom.UserDataHandler;
 import org.w3c.dom.html.HTMLBodyElement;
 import org.w3c.dom.html.HTMLCollection;
 import org.w3c.dom.html.HTMLDocument;
@@ -625,11 +627,10 @@
 
     public Node cloneNode( boolean deep )
     {
-        HTMLDocumentImpl    clone;
-
-        clone = new HTMLDocumentImpl();
-        cloneNode(clone, deep);
-        return clone;
+        HTMLDocumentImpl newdoc = new HTMLDocumentImpl();
+        callUserDataHandlers(this, newdoc, UserDataHandler.NODE_CLONED);
+        cloneNode(newdoc, deep);
+        return newdoc;
     }
 
 

Modified: xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java?rev=439176&r1=439175&r2=439176&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/CoreDocumentImpl.java Thu Aug 
31 21:45:24 2006
@@ -2418,7 +2418,7 @@
      * @param c The copy node or null.
      * @param operation The operation - import, clone, or delete.
      */
-    void callUserDataHandlers(Node n, Node c, short operation) {
+    protected void callUserDataHandlers(Node n, Node c, short operation) {
         if (userData == null) {
             return;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to