msxml3: Added node_query_inerface function for common xmlnode child objects implementation.

This commit is contained in:
Jacek Caban 2010-09-04 17:54:46 +02:00 committed by Alexandre Julliard
parent f5348b25af
commit 0670d092f1
11 changed files with 42 additions and 2 deletions

View file

@ -67,6 +67,10 @@ static HRESULT WINAPI domattr_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -74,6 +74,10 @@ static HRESULT WINAPI domcdata_QueryInterface(
TRACE("Unsupported interface\n");
return E_NOINTERFACE;
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -68,6 +68,10 @@ static HRESULT WINAPI domcomment_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -67,6 +67,10 @@ static HRESULT WINAPI domfrag_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -545,7 +545,7 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument3 *iface, REFIID rii
{
*ppvObject = &This->lpvtblISupportErrorInfo;
}
else if(dispex_query_interface(&This->node.dispex, riid, ppvObject))
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}

View file

@ -74,7 +74,7 @@ static HRESULT WINAPI domelem_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(dispex_query_interface(&This->node.dispex, riid, ppvObject))
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}

View file

@ -67,6 +67,10 @@ static HRESULT WINAPI entityref_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -162,6 +162,7 @@ static inline IXMLDOMNode *IXMLDOMNode_from_impl(xmlnode *This)
extern void init_xmlnode(xmlnode*,xmlNodePtr,IXMLDOMNode*,dispex_static_data_t*);
extern void destroy_xmlnode(xmlnode*);
extern BOOL node_query_interface(xmlnode*,REFIID,void**);
extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);

View file

@ -80,6 +80,13 @@ xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type )
return This->node;
}
BOOL node_query_interface(xmlnode *This, REFIID riid, void **ppv)
{
if(This->dispex.outer)
return dispex_query_interface(&This->dispex, riid, ppv);
return FALSE;
}
static HRESULT WINAPI xmlnode_QueryInterface(
IXMLDOMNode *iface,
REFIID riid,
@ -97,6 +104,8 @@ static HRESULT WINAPI xmlnode_QueryInterface(
}else if (IsEqualGUID( riid, &IID_IDispatch) ||
IsEqualGUID( riid, &IID_IXMLDOMNode)) {
*ppvObject = &This->lpVtbl;
}else if(node_query_interface(This, riid, ppvObject)) {
return *ppvObject ? S_OK : E_NOINTERFACE;
}else {
FIXME("interface %s not implemented\n", debugstr_guid(riid));
*ppvObject = NULL;
@ -1725,6 +1734,8 @@ void init_xmlnode(xmlnode *This, xmlNodePtr node, IXMLDOMNode *node_iface, dispe
if(dispex_data)
init_dispex(&This->dispex, (IUnknown*)This->iface, dispex_data);
else
This->dispex.outer = NULL;
}
IXMLDOMNode *create_node( xmlNodePtr node )

View file

@ -67,6 +67,10 @@ static HRESULT WINAPI dom_pi_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else
{
FIXME("Unsupported interface %s\n", debugstr_guid(riid));

View file

@ -69,6 +69,10 @@ static HRESULT WINAPI domtext_QueryInterface(
{
*ppvObject = IXMLDOMNode_from_impl(&This->node);
}
else if(node_query_interface(&This->node, riid, ppvObject))
{
return *ppvObject ? S_OK : E_NOINTERFACE;
}
else if ( IsEqualGUID( riid, &IID_IXMLDOMElement ) ||
IsEqualGUID( riid, &IID_IXMLDOMCDATASection ) )
{