Commit dc2e14d9 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Implement parentNode, firstChild, lastChild, previousSibling and

nextSibling methods.
parent 2e689c6c
...@@ -258,12 +258,28 @@ static HRESULT WINAPI xmlnode_get_nodeType( ...@@ -258,12 +258,28 @@ static HRESULT WINAPI xmlnode_get_nodeType(
return S_OK; 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( static HRESULT WINAPI xmlnode_get_parentNode(
IXMLDOMNode *iface, IXMLDOMNode *iface,
IXMLDOMNode** parent) IXMLDOMNode** parent)
{ {
FIXME("\n"); xmlnode *This = impl_from_IXMLDOMNode( iface );
return E_NOTIMPL; return get_node( This, "parent", This->node->parent, parent );
} }
static HRESULT WINAPI xmlnode_get_childNodes( static HRESULT WINAPI xmlnode_get_childNodes(
...@@ -288,32 +304,32 @@ static HRESULT WINAPI xmlnode_get_firstChild( ...@@ -288,32 +304,32 @@ static HRESULT WINAPI xmlnode_get_firstChild(
IXMLDOMNode *iface, IXMLDOMNode *iface,
IXMLDOMNode** firstChild) IXMLDOMNode** firstChild)
{ {
FIXME("\n"); xmlnode *This = impl_from_IXMLDOMNode( iface );
return E_NOTIMPL; return get_node( This, "firstChild", This->node->children, firstChild );
} }
static HRESULT WINAPI xmlnode_get_lastChild( static HRESULT WINAPI xmlnode_get_lastChild(
IXMLDOMNode *iface, IXMLDOMNode *iface,
IXMLDOMNode** lastChild) IXMLDOMNode** lastChild)
{ {
FIXME("\n"); xmlnode *This = impl_from_IXMLDOMNode( iface );
return E_NOTIMPL; return get_node( This, "lastChild", This->node->last, lastChild );
} }
static HRESULT WINAPI xmlnode_get_previousSibling( static HRESULT WINAPI xmlnode_get_previousSibling(
IXMLDOMNode *iface, IXMLDOMNode *iface,
IXMLDOMNode** previousSibling) IXMLDOMNode** previousSibling)
{ {
FIXME("\n"); xmlnode *This = impl_from_IXMLDOMNode( iface );
return E_NOTIMPL; return get_node( This, "previous", This->node->prev, previousSibling );
} }
static HRESULT WINAPI xmlnode_get_nextSibling( static HRESULT WINAPI xmlnode_get_nextSibling(
IXMLDOMNode *iface, IXMLDOMNode *iface,
IXMLDOMNode** nextSibling) IXMLDOMNode** nextSibling)
{ {
FIXME("\n"); xmlnode *This = impl_from_IXMLDOMNode( iface );
return E_NOTIMPL; return get_node( This, "next", This->node->next, nextSibling );
} }
static HRESULT WINAPI xmlnode_get_attributes( static HRESULT WINAPI xmlnode_get_attributes(
......
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