Commit 26b95dc7 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msxml3: Use IXMLDOMNode_get_nodeType in xmlnode_appendChild.

parent cabbe8fa
......@@ -661,29 +661,18 @@ static HRESULT WINAPI xmlnode_appendChild(
IXMLDOMNode** outNewChild)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
IXMLDOMNode *pAttr = NULL;
DOMNodeType type;
VARIANT var;
HRESULT hr;
TRACE("(%p)->(%p,%p)\n", This, newChild, outNewChild);
/* Cannot Append an Attribute node. */
IUnknown_QueryInterface(newChild, &IID_IXMLDOMNode, (LPVOID*)&pAttr);
if(pAttr)
{
xmlnode *ThisNew = impl_from_IXMLDOMNode( pAttr );
if(ThisNew->node->type == XML_ATTRIBUTE_NODE)
{
hr = IXMLDOMNode_get_nodeType(newChild, &type);
if(FAILED(hr) || type == NODE_ATTRIBUTE) {
if(outNewChild) *outNewChild = NULL;
IUnknown_Release(pAttr);
return E_FAIL;
}
IUnknown_Release(pAttr);
}
VariantInit(&var);
return IXMLDOMNode_insertBefore(iface, newChild, var, outNewChild);
}
......
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