msxml3: Use IXMLDOMNode_get_nodeType in xmlnode_appendChild.

This commit is contained in:
Piotr Caban 2008-07-08 20:53:58 +02:00 committed by Alexandre Julliard
parent cabbe8fa35
commit 26b95dc7fd

View File

@ -661,27 +661,16 @@ 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)
{
if(outNewChild) *outNewChild = NULL;
IUnknown_Release(pAttr);
return E_FAIL;
}
IUnknown_Release(pAttr);
hr = IXMLDOMNode_get_nodeType(newChild, &type);
if(FAILED(hr) || type == NODE_ATTRIBUTE) {
if(outNewChild) *outNewChild = NULL;
return E_FAIL;
}
VariantInit(&var);