From b22149817d11dbd072b529d290f9dc0e51d5d28c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 19 Oct 2010 03:27:48 +0400 Subject: [PATCH] msxml3: Get rid of ::put_text() forward to IXMLDOMNode interface. --- dlls/msxml3/attribute.c | 3 ++- dlls/msxml3/cdata.c | 3 ++- dlls/msxml3/comment.c | 3 ++- dlls/msxml3/docfrag.c | 3 ++- dlls/msxml3/domdoc.c | 3 ++- dlls/msxml3/element.c | 3 ++- dlls/msxml3/entityref.c | 3 ++- dlls/msxml3/msxml_private.h | 1 + dlls/msxml3/node.c | 21 +++++++++------------ dlls/msxml3/pi.c | 3 ++- dlls/msxml3/text.c | 3 ++- 11 files changed, 28 insertions(+), 21 deletions(-) diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 1a56a3513c2..f29ba489097 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -385,7 +385,8 @@ static HRESULT WINAPI domattr_put_text( BSTR p) { domattr *This = impl_from_IXMLDOMAttribute( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domattr_get_specified( diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index bbe8a87f3c7..c37923afe39 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -396,7 +396,8 @@ static HRESULT WINAPI domcdata_put_text( BSTR p) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%p)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domcdata_get_specified( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 86d4bca0a48..2ea03f4b9c8 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -389,7 +389,8 @@ static HRESULT WINAPI domcomment_put_text( BSTR p) { domcomment *This = impl_from_IXMLDOMComment( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domcomment_get_specified( diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c index d7004933001..2754ef24852 100644 --- a/dlls/msxml3/docfrag.c +++ b/dlls/msxml3/docfrag.c @@ -393,7 +393,8 @@ static HRESULT WINAPI domfrag_put_text( BSTR p) { domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domfrag_get_specified( diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 9f3f1eb4838..8230feb48a9 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -1113,7 +1113,8 @@ static HRESULT WINAPI domdoc_put_text( BSTR text ) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), text ); + TRACE("(%p)->(%s)\n", This, debugstr_w(text)); + return E_FAIL; } diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 7f3d7ef3827..a3834ffff60 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -401,7 +401,8 @@ static HRESULT WINAPI domelem_put_text( BSTR p) { domelem *This = impl_from_IXMLDOMElement( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domelem_get_specified( diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index f4c31c933fe..2a936bc7128 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -387,7 +387,8 @@ static HRESULT WINAPI entityref_put_text( BSTR p) { entityref *This = impl_from_IXMLDOMEntityReference( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI entityref_get_specified( diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 5d0ac7ac5e2..fcf3dc0df8f 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -171,6 +171,7 @@ extern HRESULT node_get_previous_sibling(xmlnode*,IXMLDOMNode**); extern HRESULT node_get_next_sibling(xmlnode*,IXMLDOMNode**); extern HRESULT node_insert_before(xmlnode*,IXMLDOMNode*,const VARIANT*,IXMLDOMNode**); extern HRESULT node_replace_child(xmlnode*,IXMLDOMNode*,IXMLDOMNode*,IXMLDOMNode**); +extern HRESULT node_put_text(xmlnode*,BSTR); extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 6716c5d907a..56d41ee878f 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -745,23 +745,12 @@ static HRESULT WINAPI xmlnode_get_text( return S_OK; } -static HRESULT WINAPI xmlnode_put_text( - IXMLDOMNode *iface, - BSTR text) +HRESULT node_put_text(xmlnode *This, BSTR text) { - xmlnode *This = impl_from_IXMLDOMNode( iface ); xmlChar *str, *str2; TRACE("(%p)->(%s)\n", This, debugstr_w(text)); - switch(This->node->type) - { - case XML_DOCUMENT_NODE: - return E_FAIL; - default: - break; - } - str = xmlChar_from_wchar(text); /* Escape the string. */ @@ -774,6 +763,14 @@ static HRESULT WINAPI xmlnode_put_text( return S_OK; } +static HRESULT WINAPI xmlnode_put_text( + IXMLDOMNode *iface, + BSTR text) +{ + ERR("Should not be called\n"); + return E_NOTIMPL; +} + static HRESULT WINAPI xmlnode_get_specified( IXMLDOMNode *iface, VARIANT_BOOL* isSpecified) diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index 2467603b51e..6bd34c07069 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -403,7 +403,8 @@ static HRESULT WINAPI dom_pi_put_text( BSTR p) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI dom_pi_get_specified( diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index 2e79cd9d4a8..521d750acd9 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -402,7 +402,8 @@ static HRESULT WINAPI domtext_put_text( BSTR p) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_put_text( IXMLDOMNode_from_impl(&This->node), p ); + TRACE("(%p)->(%s)\n", This, debugstr_w(p)); + return node_put_text( &This->node, p ); } static HRESULT WINAPI domtext_get_specified(