Commit 8036509c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

msxml3: Don't use xmlnode's IXMLDOMNode iface in get_nodeTypeString implementations.

parent 668f417b
......@@ -370,7 +370,11 @@ static HRESULT WINAPI domattr_get_nodeTypeString(
BSTR* p)
{
domattr *This = impl_from_IXMLDOMAttribute( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR attributeW[] = {'a','t','t','r','i','b','u','t','e',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(attributeW, p);
}
static HRESULT WINAPI domattr_get_text(
......
......@@ -381,7 +381,11 @@ static HRESULT WINAPI domcdata_get_nodeTypeString(
BSTR* p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR cdatasectionW[] = {'c','d','a','t','a','s','e','c','t','i','o','n',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(cdatasectionW, p);
}
static HRESULT WINAPI domcdata_get_text(
......
......@@ -374,7 +374,11 @@ static HRESULT WINAPI domcomment_get_nodeTypeString(
BSTR* p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR commentW[] = {'c','o','m','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(commentW, p);
}
static HRESULT WINAPI domcomment_get_text(
......
......@@ -378,7 +378,11 @@ static HRESULT WINAPI domfrag_get_nodeTypeString(
BSTR* p)
{
domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR documentfragmentW[] = {'d','o','c','u','m','e','n','t','f','r','a','g','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(documentfragmentW, p);
}
static HRESULT WINAPI domfrag_get_text(
......
......@@ -1190,10 +1190,14 @@ static HRESULT WINAPI domdoc_cloneNode(
static HRESULT WINAPI domdoc_get_nodeTypeString(
IXMLDOMDocument3 *iface,
BSTR* nodeType )
BSTR *p)
{
domdoc *This = impl_from_IXMLDOMDocument3( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), nodeType );
static const WCHAR documentW[] = {'d','o','c','u','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(documentW, p);
}
......
......@@ -386,7 +386,11 @@ static HRESULT WINAPI domelem_get_nodeTypeString(
BSTR* p)
{
domelem *This = impl_from_IXMLDOMElement( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR elementW[] = {'e','l','e','m','e','n','t',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(elementW, p);
}
static HRESULT WINAPI domelem_get_text(
......
......@@ -372,7 +372,11 @@ static HRESULT WINAPI entityref_get_nodeTypeString(
BSTR* p)
{
entityref *This = impl_from_IXMLDOMEntityReference( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR entityreferenceW[] = {'e','n','t','i','t','y','r','e','f','e','r','e','n','c','e',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(entityreferenceW, p);
}
static HRESULT WINAPI entityref_get_text(
......
......@@ -521,69 +521,6 @@ HRESULT node_clone(xmlnode *This, VARIANT_BOOL deep, IXMLDOMNode **cloneNode)
return S_OK;
}
static HRESULT WINAPI xmlnode_get_nodeTypeString(
IXMLDOMNode *iface,
BSTR* xmlnodeType)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
const xmlChar *str;
TRACE("(%p)->(%p)\n", This, xmlnodeType );
if (!xmlnodeType)
return E_INVALIDARG;
if ( !This->node )
return E_FAIL;
switch( This->node->type )
{
case XML_ATTRIBUTE_NODE:
str = (const xmlChar*) "attribute";
break;
case XML_CDATA_SECTION_NODE:
str = (const xmlChar*) "cdatasection";
break;
case XML_COMMENT_NODE:
str = (const xmlChar*) "comment";
break;
case XML_DOCUMENT_NODE:
str = (const xmlChar*) "document";
break;
case XML_DOCUMENT_FRAG_NODE:
str = (const xmlChar*) "documentfragment";
break;
case XML_ELEMENT_NODE:
str = (const xmlChar*) "element";
break;
case XML_ENTITY_NODE:
str = (const xmlChar*) "entity";
break;
case XML_ENTITY_REF_NODE:
str = (const xmlChar*) "entityreference";
break;
case XML_NOTATION_NODE:
str = (const xmlChar*) "notation";
break;
case XML_PI_NODE:
str = (const xmlChar*) "processinginstruction";
break;
case XML_TEXT_NODE:
str = (const xmlChar*) "text";
break;
default:
FIXME("Unknown node type (%d)\n", This->node->type);
str = This->node->name;
break;
}
*xmlnodeType = bstr_from_xmlChar( str );
if (!*xmlnodeType)
return S_FALSE;
return S_OK;
}
static inline xmlChar* trim_whitespace(xmlChar* str)
{
xmlChar* ret = str;
......@@ -1344,7 +1281,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl =
xmlnode_hasChildNodes,
xmlnode_get_ownerDocument,
NULL,
xmlnode_get_nodeTypeString,
NULL,
xmlnode_get_text,
NULL,
NULL,
......@@ -1726,7 +1663,10 @@ static HRESULT WINAPI unknode_get_nodeTypeString(
BSTR* p)
{
unknode *This = impl_from_unkIXMLDOMNode( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
FIXME("(%p)->(%p)\n", This, p);
return node_get_nodeName(&This->node, p);
}
static HRESULT WINAPI unknode_get_text(
......
......@@ -388,7 +388,12 @@ static HRESULT WINAPI dom_pi_get_nodeTypeString(
BSTR* p)
{
dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR processinginstructionW[] =
{'p','r','o','c','e','s','s','i','n','g','i','n','s','t','r','u','c','t','i','o','n',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(processinginstructionW, p);
}
static HRESULT WINAPI dom_pi_get_text(
......
......@@ -387,7 +387,11 @@ static HRESULT WINAPI domtext_get_nodeTypeString(
BSTR* p)
{
domtext *This = impl_from_IXMLDOMText( iface );
return IXMLDOMNode_get_nodeTypeString( IXMLDOMNode_from_impl(&This->node), p );
static const WCHAR textW[] = {'t','e','x','t',0};
TRACE("(%p)->(%p)\n", This, p);
return return_bstr(textW, p);
}
static HRESULT WINAPI domtext_get_text(
......
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