Use a single function to create all IXMLDOMNode implementations.
This commit is contained in:
parent
3f2d5d7fbb
commit
2386023474
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue