Commit e7ff1019 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

msxml3: Update orphaned list in put_documentElement.

parent dee8657b
......@@ -922,6 +922,7 @@ static HRESULT WINAPI domdoc_put_documentElement(
{
domdoc *This = impl_from_IXMLDOMDocument2( iface );
IXMLDOMNode *elementNode;
xmlNodePtr oldRoot;
xmlnode *xmlNode;
HRESULT hr;
......@@ -932,9 +933,17 @@ static HRESULT WINAPI domdoc_put_documentElement(
return hr;
xmlNode = impl_from_IXMLDOMNode( elementNode );
xmlDocSetRootElement( get_doc(This), xmlNode->node);
if(!xmlNode->node->parent)
if(xmldoc_remove_orphan(xmlNode->node->doc, xmlNode->node) != S_OK)
WARN("%p is not an orphan of %p\n", xmlNode->node->doc, xmlNode->node);
oldRoot = xmlDocSetRootElement( get_doc(This), xmlNode->node);
IXMLDOMNode_Release( elementNode );
if(oldRoot)
xmldoc_add_orphan(oldRoot->doc, oldRoot);
return S_OK;
}
......
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