Commit 9fe98546 authored by Michael Karcher's avatar Michael Karcher Committed by Alexandre Julliard

msxml3: Text node should not aggregate element.

parent 64e44d11
......@@ -559,6 +559,9 @@ static void test_domdoc( void )
{
IXMLDOMNamedNodeMap *pAttribs;
r = IXMLDOMText_QueryInterface(nodetext, &IID_IXMLDOMElement, (LPVOID*)&element);
ok(r == E_NOINTERFACE, "ret %08x\n", r );
/* Text Last Child Checks */
r = IXMLDOMText_get_lastChild(nodetext, NULL);
ok(r == E_INVALIDARG, "ret %08x\n", r );
......
......@@ -42,7 +42,7 @@ typedef struct _domtext
{
const struct IXMLDOMTextVtbl *lpVtbl;
LONG ref;
IUnknown *element_unk;
IUnknown *node_unk;
IXMLDOMNode *node;
} domtext;
......@@ -66,10 +66,9 @@ static HRESULT WINAPI domtext_QueryInterface(
{
*ppvObject = iface;
}
else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ||
IsEqualGUID( riid, &IID_IXMLDOMElement ) )
else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) )
{
return IUnknown_QueryInterface(This->element_unk, riid, ppvObject);
return IUnknown_QueryInterface(This->node_unk, riid, ppvObject);
}
else
{
......@@ -98,7 +97,7 @@ static ULONG WINAPI domtext_Release(
ref = InterlockedDecrement( &This->ref );
if ( ref == 0 )
{
IUnknown_Release( This->element_unk );
IUnknown_Release( This->node_unk );
HeapFree( GetProcessHeap(), 0, This );
}
......@@ -773,17 +772,17 @@ IUnknown* create_text( xmlNodePtr text )
This->lpVtbl = &domtext_vtbl;
This->ref = 1;
This->element_unk = create_element( text, (IUnknown*)&This->lpVtbl );
if(!This->element_unk)
This->node_unk = create_basic_node( text, (IUnknown*)&This->lpVtbl );
if(!This->node_unk)
{
HeapFree(GetProcessHeap(), 0, This);
return NULL;
}
hr = IUnknown_QueryInterface(This->element_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node);
hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node);
if(FAILED(hr))
{
IUnknown_Release(This->element_unk);
IUnknown_Release(This->node_unk);
HeapFree( GetProcessHeap(), 0, This );
return NULL;
}
......
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