Commit fd925d0e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Remove child node in one place in node_insert_before().

parent 4782be7e
......@@ -477,6 +477,7 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
xmlnode *before_node_obj = get_node_obj(before);
IXMLDOMNode_Release(before);
if(!before_node_obj) return E_FAIL;
}
/* unlink from current parent first */
if(node_obj->parent)
......@@ -484,9 +485,12 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
hr = IXMLDOMNode_removeChild(node_obj->parent, node_obj->iface, NULL);
if (hr == S_OK) xmldoc_remove_orphan(node_obj->node->doc, node_obj->node);
}
doc = node_obj->node->doc;
if(before)
{
xmlnode *before_node_obj = get_node_obj(before);
/* refs count including subtree */
if (doc != before_node_obj->node->doc)
refcount = xmlnode_get_inst_cnt(node_obj);
......@@ -498,14 +502,6 @@ HRESULT node_insert_before(xmlnode *This, IXMLDOMNode *new_child, const VARIANT
}
else
{
/* unlink from current parent first */
if(node_obj->parent)
{
hr = IXMLDOMNode_removeChild(node_obj->parent, node_obj->iface, NULL);
if (hr == S_OK) xmldoc_remove_orphan(node_obj->node->doc, node_obj->node);
}
doc = node_obj->node->doc;
if (doc != This->node->doc)
refcount = xmlnode_get_inst_cnt(node_obj);
......
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