From 2386023474333ab1cbe653f665850916f4744888 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Fri, 19 Aug 2005 10:03:27 +0000 Subject: [PATCH] Use a single function to create all IXMLDOMNode implementations. --- dlls/msxml3/domdoc.c | 4 ++-- dlls/msxml3/element.c | 2 +- dlls/msxml3/msxml_private.h | 7 ++----- dlls/msxml3/node.c | 22 +--------------------- dlls/msxml3/nodemap.c | 2 +- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index fd96b280728..be85ababaa2 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -729,7 +729,7 @@ static HRESULT WINAPI domdoc_load( if ( !xmldoc ) return S_FALSE; - This->node = create_domdoc_node( xmldoc ); + This->node = create_node( (xmlNodePtr) xmldoc ); if ( !This->node ) { *isSuccessful = VARIANT_FALSE; @@ -847,7 +847,7 @@ static HRESULT WINAPI domdoc_loadXML( xmldoc = doparse( str, len ); HeapFree( GetProcessHeap(), 0, str ); - This->node = create_domdoc_node( xmldoc ); + This->node = create_node( (xmlNodePtr) xmldoc ); if( !This->node ) return S_FALSE; diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 7a153e8a969..81fdbf4860e 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -580,7 +580,7 @@ IXMLDOMElement* create_element( xmlNodePtr element ) return NULL; This->lpVtbl = &domelem_vtbl; - This->node = create_element_node( element ); + This->node = create_node( element ); This->ref = 1; if ( !This->node ) diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 788343ce788..7398c1e982e 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -30,15 +30,12 @@ #endif /* constructors */ -extern IXMLDOMNode *create_domdoc_node( xmlDocPtr node ); extern IUnknown *create_domdoc( void ); -extern IXMLDOMNode *create_attribute_node( xmlAttrPtr attr ); extern IUnknown *create_xmldoc( void ); +extern IXMLDOMNode *create_node( xmlNodePtr node ); extern IXMLDOMElement *create_element( xmlNodePtr element ); -extern IXMLDOMNode *create_element_node( xmlNodePtr element ); -extern IXMLDOMNamedNodeMap *create_nodemap( IXMLDOMNode *node ); -extern IXMLDOMNode *create_generic_node( xmlNodePtr node ); extern IXMLDOMNodeList *create_nodelist( xmlNodePtr node ); +extern IXMLDOMNamedNodeMap *create_nodemap( IXMLDOMNode *node ); /* data accessors */ xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 657b16c513d..3fc0b867763 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -624,7 +624,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl = xmlnode_transformNodeToObject, }; -static IXMLDOMNode *create_node( xmlNodePtr node ) +IXMLDOMNode *create_node( xmlNodePtr node ) { xmlnode *This; @@ -670,24 +670,4 @@ static IXMLDOMNode *create_node( xmlNodePtr node ) return (IXMLDOMNode*) &This->lpVtbl; } -IXMLDOMNode *create_domdoc_node( xmlDocPtr node ) -{ - return create_node( (xmlNodePtr) node ); -} - -IXMLDOMNode *create_attribute_node( xmlAttrPtr node ) -{ - return create_node( (xmlNodePtr) node ); -} - -IXMLDOMNode *create_element_node( xmlNodePtr element ) -{ - return create_node( element ); -} - -IXMLDOMNode *create_generic_node( xmlNodePtr node ) -{ - return create_node( node ); -} - #endif diff --git a/dlls/msxml3/nodemap.c b/dlls/msxml3/nodemap.c index 6659bfc2ad6..9062353d46a 100644 --- a/dlls/msxml3/nodemap.c +++ b/dlls/msxml3/nodemap.c @@ -168,7 +168,7 @@ static HRESULT WINAPI xmlnodemap_getNamedItem( if ( !attr ) return E_FAIL; - *namedItem = create_attribute_node( attr ); + *namedItem = create_node( (xmlNodePtr) attr ); return S_OK; }