From dc2e14d9f6559469632a8178c87c346d2e24845b Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Fri, 19 Aug 2005 11:22:47 +0000 Subject: [PATCH] Implement parentNode, firstChild, lastChild, previousSibling and nextSibling methods. --- dlls/msxml3/node.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 3fc0b867763..479ad474a5e 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -258,12 +258,28 @@ static HRESULT WINAPI xmlnode_get_nodeType( return S_OK; } +static HRESULT get_node( + xmlnode *This, + const char *name, + xmlNodePtr node, + IXMLDOMNode **out ) +{ + TRACE("%p->%s %p\n", This, name, node ); + + if ( !out ) + return E_INVALIDARG; + *out = create_node( node ); + if (!*out) + return S_FALSE; + return S_OK; +} + static HRESULT WINAPI xmlnode_get_parentNode( IXMLDOMNode *iface, IXMLDOMNode** parent) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + return get_node( This, "parent", This->node->parent, parent ); } static HRESULT WINAPI xmlnode_get_childNodes( @@ -288,32 +304,32 @@ static HRESULT WINAPI xmlnode_get_firstChild( IXMLDOMNode *iface, IXMLDOMNode** firstChild) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + return get_node( This, "firstChild", This->node->children, firstChild ); } static HRESULT WINAPI xmlnode_get_lastChild( IXMLDOMNode *iface, IXMLDOMNode** lastChild) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + return get_node( This, "lastChild", This->node->last, lastChild ); } static HRESULT WINAPI xmlnode_get_previousSibling( IXMLDOMNode *iface, IXMLDOMNode** previousSibling) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + return get_node( This, "previous", This->node->prev, previousSibling ); } static HRESULT WINAPI xmlnode_get_nextSibling( IXMLDOMNode *iface, IXMLDOMNode** nextSibling) { - FIXME("\n"); - return E_NOTIMPL; + xmlnode *This = impl_from_IXMLDOMNode( iface ); + return get_node( This, "next", This->node->next, nextSibling ); } static HRESULT WINAPI xmlnode_get_attributes(