Commit 27980430 authored by Daniel Lehman's avatar Daniel Lehman Committed by Alexandre Julliard

msxml3: Allow creating floating attributes.

parent 377243b4
......@@ -50,6 +50,7 @@ typedef struct _domattr
xmlnode node;
IXMLDOMAttribute IXMLDOMAttribute_iface;
LONG ref;
BOOL floating;
} domattr;
static const tid_t domattr_se_tids[] = {
......@@ -116,6 +117,11 @@ static ULONG WINAPI domattr_Release(
if ( ref == 0 )
{
destroy_xmlnode(&This->node);
if ( This->floating )
{
xmlFreeNs( This->node.node->ns );
xmlFreeNode( This->node.node );
}
heap_free( This );
}
......@@ -709,7 +715,7 @@ static dispex_static_data_t domattr_dispex = {
domattr_iface_tids
};
IUnknown* create_attribute( xmlNodePtr attribute )
IUnknown* create_attribute( xmlNodePtr attribute, BOOL floating )
{
domattr *This;
......@@ -719,6 +725,7 @@ IUnknown* create_attribute( xmlNodePtr attribute )
This->IXMLDOMAttribute_iface.lpVtbl = &domattr_vtbl;
This->ref = 1;
This->floating = floating;
init_xmlnode(&This->node, attribute, (IXMLDOMNode*)&This->IXMLDOMAttribute_iface, &domattr_dispex);
......
......@@ -1398,7 +1398,7 @@ static HRESULT WINAPI domelem_getAttributeNode(
if (attr)
{
IUnknown *unk = create_attribute((xmlNodePtr)attr);
IUnknown *unk = create_attribute((xmlNodePtr)attr, FALSE);
hr = IUnknown_QueryInterface(unk, &IID_IXMLDOMAttribute, (void**)attributeNode);
IUnknown_Release(unk);
}
......
......@@ -252,7 +252,7 @@ extern IUnknown *create_domdoc( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_xmldoc( void ) DECLSPEC_HIDDEN;
extern IXMLDOMNode *create_node( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_element( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_attribute( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_attribute( xmlNodePtr, BOOL ) DECLSPEC_HIDDEN;
extern IUnknown *create_text( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_pi( xmlNodePtr ) DECLSPEC_HIDDEN;
extern IUnknown *create_comment( xmlNodePtr ) DECLSPEC_HIDDEN;
......
......@@ -2271,7 +2271,7 @@ IXMLDOMNode *create_node( xmlNodePtr node )
pUnk = create_element( node );
break;
case XML_ATTRIBUTE_NODE:
pUnk = create_attribute( node );
pUnk = create_attribute( node, FALSE );
break;
case XML_TEXT_NODE:
pUnk = create_text( node );
......
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