Commit 2b5ddbfe authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Properly update node to doc link when cloning.

parent 2f5123cb
......@@ -595,7 +595,7 @@ HRESULT node_clone(xmlnode *This, VARIANT_BOOL deep, IXMLDOMNode **cloneNode)
clone = xmlCopyNode(This->node, deep ? 1 : 2);
if (clone)
{
clone->doc = This->node->doc;
xmlSetTreeDoc(clone, This->node->doc);
xmldoc_add_orphan(clone->doc, clone);
node = create_node(clone);
......
......@@ -6073,7 +6073,7 @@ static void test_cloneNode(void )
IXMLDOMNamedNodeMap *mapAttr;
LONG length, length1;
LONG attr_cnt, attr_cnt1;
IXMLDOMNode *node;
IXMLDOMNode *node, *attr;
IXMLDOMNode *node_clone;
IXMLDOMNode *node_first;
HRESULT hr;
......@@ -6134,6 +6134,11 @@ static void test_cloneNode(void )
hr = IXMLDOMNamedNodeMap_get_length(mapAttr, &attr_cnt1);
ok( hr == S_OK, "ret %08x\n", hr );
ok(attr_cnt1 == 3, "got %d\n", attr_cnt1);
/* now really get some attributes from cloned element */
attr = NULL;
hr = IXMLDOMNamedNodeMap_getNamedItem(mapAttr, _bstr_("id"), &attr);
ok(hr == S_OK, "ret %08x\n", hr);
IXMLDOMNode_Release(attr);
IXMLDOMNamedNodeMap_Release(mapAttr);
ok(length == length1, "wrong Child count (%d, %d)\n", length, length1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment