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

Use a single function to create all IXMLDOMNode implementations.

parent 3f2d5d7f
...@@ -729,7 +729,7 @@ static HRESULT WINAPI domdoc_load( ...@@ -729,7 +729,7 @@ static HRESULT WINAPI domdoc_load(
if ( !xmldoc ) if ( !xmldoc )
return S_FALSE; return S_FALSE;
This->node = create_domdoc_node( xmldoc ); This->node = create_node( (xmlNodePtr) xmldoc );
if ( !This->node ) if ( !This->node )
{ {
*isSuccessful = VARIANT_FALSE; *isSuccessful = VARIANT_FALSE;
...@@ -847,7 +847,7 @@ static HRESULT WINAPI domdoc_loadXML( ...@@ -847,7 +847,7 @@ static HRESULT WINAPI domdoc_loadXML(
xmldoc = doparse( str, len ); xmldoc = doparse( str, len );
HeapFree( GetProcessHeap(), 0, str ); HeapFree( GetProcessHeap(), 0, str );
This->node = create_domdoc_node( xmldoc ); This->node = create_node( (xmlNodePtr) xmldoc );
if( !This->node ) if( !This->node )
return S_FALSE; return S_FALSE;
......
...@@ -580,7 +580,7 @@ IXMLDOMElement* create_element( xmlNodePtr element ) ...@@ -580,7 +580,7 @@ IXMLDOMElement* create_element( xmlNodePtr element )
return NULL; return NULL;
This->lpVtbl = &domelem_vtbl; This->lpVtbl = &domelem_vtbl;
This->node = create_element_node( element ); This->node = create_node( element );
This->ref = 1; This->ref = 1;
if ( !This->node ) if ( !This->node )
......
...@@ -30,15 +30,12 @@ ...@@ -30,15 +30,12 @@
#endif #endif
/* constructors */ /* constructors */
extern IXMLDOMNode *create_domdoc_node( xmlDocPtr node );
extern IUnknown *create_domdoc( void ); extern IUnknown *create_domdoc( void );
extern IXMLDOMNode *create_attribute_node( xmlAttrPtr attr );
extern IUnknown *create_xmldoc( void ); extern IUnknown *create_xmldoc( void );
extern IXMLDOMNode *create_node( xmlNodePtr node );
extern IXMLDOMElement *create_element( xmlNodePtr element ); 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 IXMLDOMNodeList *create_nodelist( xmlNodePtr node );
extern IXMLDOMNamedNodeMap *create_nodemap( IXMLDOMNode *node );
/* data accessors */ /* data accessors */
xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type ); xmlNodePtr xmlNodePtr_from_domnode( IXMLDOMNode *iface, xmlElementType type );
......
...@@ -624,7 +624,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl = ...@@ -624,7 +624,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl =
xmlnode_transformNodeToObject, xmlnode_transformNodeToObject,
}; };
static IXMLDOMNode *create_node( xmlNodePtr node ) IXMLDOMNode *create_node( xmlNodePtr node )
{ {
xmlnode *This; xmlnode *This;
...@@ -670,24 +670,4 @@ static IXMLDOMNode *create_node( xmlNodePtr node ) ...@@ -670,24 +670,4 @@ static IXMLDOMNode *create_node( xmlNodePtr node )
return (IXMLDOMNode*) &This->lpVtbl; 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 #endif
...@@ -168,7 +168,7 @@ static HRESULT WINAPI xmlnodemap_getNamedItem( ...@@ -168,7 +168,7 @@ static HRESULT WINAPI xmlnodemap_getNamedItem(
if ( !attr ) if ( !attr )
return E_FAIL; return E_FAIL;
*namedItem = create_attribute_node( attr ); *namedItem = create_node( (xmlNodePtr) attr );
return S_OK; return S_OK;
} }
......
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