Commit 4f210e21 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

msxml3: Don't use xmlnode's IXMLDOMNode iface in get_[first|last]Node implementations.

parent c8b15e90
......@@ -249,7 +249,10 @@ static HRESULT WINAPI domattr_get_firstChild(
IXMLDOMNode** domNode)
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domattr_get_lastChild(
......@@ -257,7 +260,10 @@ static HRESULT WINAPI domattr_get_lastChild(
IXMLDOMNode** domNode)
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domattr_get_previousSibling(
......
......@@ -260,7 +260,10 @@ static HRESULT WINAPI domcdata_get_firstChild(
IXMLDOMNode** domNode)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domcdata_get_lastChild(
......@@ -268,7 +271,10 @@ static HRESULT WINAPI domcdata_get_lastChild(
IXMLDOMNode** domNode)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domcdata_get_previousSibling(
......
......@@ -253,7 +253,10 @@ static HRESULT WINAPI domcomment_get_firstChild(
IXMLDOMNode** domNode)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domcomment_get_lastChild(
......@@ -261,7 +264,10 @@ static HRESULT WINAPI domcomment_get_lastChild(
IXMLDOMNode** domNode)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domcomment_get_previousSibling(
......
......@@ -255,7 +255,10 @@ static HRESULT WINAPI domfrag_get_firstChild(
IXMLDOMNode** domNode)
{
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domfrag_get_lastChild(
......@@ -263,7 +266,10 @@ static HRESULT WINAPI domfrag_get_lastChild(
IXMLDOMNode** domNode)
{
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domfrag_get_previousSibling(
......
......@@ -764,7 +764,10 @@ static HRESULT WINAPI domdoc_get_firstChild(
IXMLDOMNode** firstChild )
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), firstChild );
TRACE("(%p)->(%p)\n", This, firstChild);
return node_get_first_child(&This->node, firstChild);
}
......@@ -773,7 +776,10 @@ static HRESULT WINAPI domdoc_get_lastChild(
IXMLDOMNode** lastChild )
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), lastChild );
TRACE("(%p)->(%p)\n", This, lastChild);
return node_get_first_child(&This->node, lastChild);
}
......
......@@ -264,7 +264,10 @@ static HRESULT WINAPI domelem_get_firstChild(
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domelem_get_lastChild(
......@@ -272,7 +275,10 @@ static HRESULT WINAPI domelem_get_lastChild(
IXMLDOMNode** domNode)
{
domelem *This = impl_from_IXMLDOMElement( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI domelem_get_previousSibling(
......
......@@ -251,7 +251,10 @@ static HRESULT WINAPI entityref_get_firstChild(
IXMLDOMNode** domNode)
{
entityref *This = impl_from_IXMLDOMEntityReference( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI entityref_get_lastChild(
......@@ -259,7 +262,10 @@ static HRESULT WINAPI entityref_get_lastChild(
IXMLDOMNode** domNode)
{
entityref *This = impl_from_IXMLDOMEntityReference( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI entityref_get_previousSibling(
......
......@@ -164,6 +164,8 @@ extern HRESULT node_get_content(xmlnode*,VARIANT*);
extern HRESULT node_put_value(xmlnode*,VARIANT*);
extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**);
extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**);
extern HRESULT node_get_first_child(xmlnode*,IXMLDOMNode**);
extern HRESULT node_get_last_child(xmlnode*,IXMLDOMNode**);
extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);
......@@ -200,6 +202,14 @@ static inline HRESULT return_bstr(const WCHAR *value, BSTR *p)
return S_OK;
}
static inline HRESULT return_null_node(IXMLDOMNode **p)
{
if(!p)
return E_INVALIDARG;
*p = NULL;
return S_FALSE;
}
#endif
void* libxslt_handle;
......
......@@ -313,38 +313,30 @@ static HRESULT WINAPI xmlnode_get_childNodes(
return E_NOTIMPL;
}
HRESULT node_get_first_child(xmlnode *This, IXMLDOMNode **ret)
{
return get_node(This, "firstChild", This->node->children, ret);
}
static HRESULT WINAPI xmlnode_get_firstChild(
IXMLDOMNode *iface,
IXMLDOMNode** firstChild)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
TRACE("(%p)->(%p)\n", This, firstChild);
return get_node( This, "firstChild", This->node->children, firstChild );
ERR("Should not be called\n");
return E_NOTIMPL;
}
HRESULT node_get_last_child(xmlnode *This, IXMLDOMNode **ret)
{
return get_node(This, "lastChild", This->node->last, ret);
}
static HRESULT WINAPI xmlnode_get_lastChild(
IXMLDOMNode *iface,
IXMLDOMNode** lastChild)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
TRACE("(%p)->(%p)\n", This, lastChild );
if (!lastChild)
return E_INVALIDARG;
switch( This->node->type )
{
/* CDATASection, Comment, PI and Text Nodes do not support lastChild */
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
*lastChild = NULL;
return S_FALSE;
default:
return get_node( This, "lastChild", This->node->last, lastChild );
}
ERR("Should not be called\n");
return E_NOTIMPL;
}
static HRESULT WINAPI xmlnode_get_previousSibling(
......@@ -1838,7 +1830,10 @@ static HRESULT WINAPI unknode_get_firstChild(
IXMLDOMNode** domNode)
{
unknode *This = impl_from_unkIXMLDOMNode( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI unknode_get_lastChild(
......@@ -1846,7 +1841,10 @@ static HRESULT WINAPI unknode_get_lastChild(
IXMLDOMNode** domNode)
{
unknode *This = impl_from_unkIXMLDOMNode( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return node_get_first_child(&This->node, domNode);
}
static HRESULT WINAPI unknode_get_previousSibling(
......
......@@ -266,7 +266,10 @@ static HRESULT WINAPI dom_pi_get_firstChild(
IXMLDOMNode** domNode)
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI dom_pi_get_lastChild(
......@@ -274,7 +277,10 @@ static HRESULT WINAPI dom_pi_get_lastChild(
IXMLDOMNode** domNode)
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI dom_pi_get_previousSibling(
......
......@@ -266,7 +266,10 @@ static HRESULT WINAPI domtext_get_firstChild(
IXMLDOMNode** domNode)
{
domtext *This = impl_from_IXMLDOMText( iface );
return IXMLDOMNode_get_firstChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domtext_get_lastChild(
......@@ -274,7 +277,10 @@ static HRESULT WINAPI domtext_get_lastChild(
IXMLDOMNode** domNode)
{
domtext *This = impl_from_IXMLDOMText( iface );
return IXMLDOMNode_get_lastChild( IXMLDOMNode_from_impl(&This->node), domNode );
TRACE("(%p)->(%p)\n", This, domNode);
return return_null_node(domNode);
}
static HRESULT WINAPI domtext_get_previousSibling(
......
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