From bf01d1b3d73d57f06364d0cec0151f7bc83aa721 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Wed, 23 Feb 2011 15:03:42 +0300 Subject: [PATCH] msxml3: Remove transformNode() forward. --- dlls/msxml3/attribute.c | 5 +-- dlls/msxml3/cdata.c | 5 +-- dlls/msxml3/comment.c | 5 +-- dlls/msxml3/docfrag.c | 5 +-- dlls/msxml3/domdoc.c | 7 ++-- dlls/msxml3/element.c | 5 +-- dlls/msxml3/entityref.c | 5 +-- dlls/msxml3/msxml_private.h | 1 + dlls/msxml3/node.c | 67 +++++++++++++++---------------------- dlls/msxml3/pi.c | 5 +-- dlls/msxml3/text.c | 5 +-- 11 files changed, 56 insertions(+), 59 deletions(-) diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 332c2567e36..60af5a43fea 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -478,10 +478,11 @@ static HRESULT WINAPI domattr_get_xml( static HRESULT WINAPI domattr_transformNode( IXMLDOMAttribute *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domattr *This = impl_from_IXMLDOMAttribute( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domattr_selectNodes( diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index 0a5f631b876..16c2df283f2 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -488,10 +488,11 @@ static HRESULT WINAPI domcdata_get_xml( static HRESULT WINAPI domcdata_transformNode( IXMLDOMCDATASection *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domcdata *This = impl_from_IXMLDOMCDATASection( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domcdata_selectNodes( diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 4724ba3555d..435c4af83a1 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -481,10 +481,11 @@ static HRESULT WINAPI domcomment_get_xml( static HRESULT WINAPI domcomment_transformNode( IXMLDOMComment *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domcomment *This = impl_from_IXMLDOMComment( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domcomment_selectNodes( diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c index cf0129631f8..5862b6f85d8 100644 --- a/dlls/msxml3/docfrag.c +++ b/dlls/msxml3/docfrag.c @@ -485,10 +485,11 @@ static HRESULT WINAPI domfrag_get_xml( static HRESULT WINAPI domfrag_transformNode( IXMLDOMDocumentFragment *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domfrag_selectNodes( diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 3c51e4fef6c..c89f55f6e75 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -1432,11 +1432,12 @@ static HRESULT WINAPI domdoc_get_xml( static HRESULT WINAPI domdoc_transformNode( IXMLDOMDocument3 *iface, - IXMLDOMNode* styleSheet, - BSTR* xmlString ) + IXMLDOMNode *node, + BSTR *p) { domdoc *This = impl_from_IXMLDOMDocument3( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, styleSheet, xmlString ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index e0091766d6f..b7b623c1ad5 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -937,10 +937,11 @@ static HRESULT WINAPI domelem_get_xml( static HRESULT WINAPI domelem_transformNode( IXMLDOMElement *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domelem *This = impl_from_IXMLDOMElement( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domelem_selectNodes( diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c index 2e250bb78e5..1c3bd7d7f7b 100644 --- a/dlls/msxml3/entityref.c +++ b/dlls/msxml3/entityref.c @@ -479,10 +479,11 @@ static HRESULT WINAPI entityref_get_xml( static HRESULT WINAPI entityref_transformNode( IXMLDOMEntityReference *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { entityref *This = impl_from_IXMLDOMEntityReference( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI entityref_selectNodes( diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index f8241e26095..59ad33bd389 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -270,6 +270,7 @@ extern HRESULT node_get_owner_doc(const xmlnode*,IXMLDOMDocument**); extern HRESULT node_get_text(const xmlnode*,BSTR*); extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**); extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**); +extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*); extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index e2f50b5c225..26b648cf116 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -952,66 +952,54 @@ HRESULT node_get_xml(xmlnode *This, BOOL ensure_eol, BOOL ensure_no_encoding, BS return *ret ? S_OK : E_OUTOFMEMORY; } -static HRESULT WINAPI xmlnode_transformNode( - IXMLDOMNode *iface, - IXMLDOMNode* styleSheet, - BSTR* xmlString) +HRESULT node_transform_node(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p) { #ifdef SONAME_LIBXSLT - xmlnode *This = impl_from_IXMLDOMNode( iface ); - xmlnode *pStyleSheet = NULL; - xsltStylesheetPtr xsltSS = NULL; - xmlDocPtr result = NULL; + xsltStylesheetPtr xsltSS; + xmlnode *sheet; - TRACE("(%p)->(%p %p)\n", This, styleSheet, xmlString); + if (!libxslt_handle) return E_NOTIMPL; + if (!stylesheet || !p) return E_INVALIDARG; - if (!libxslt_handle) - return E_NOTIMPL; - if(!styleSheet || !xmlString) - return E_INVALIDARG; + *p = NULL; - *xmlString = NULL; - - pStyleSheet = get_node_obj(styleSheet); - if(!pStyleSheet) { + sheet = get_node_obj(stylesheet); + if(!sheet) { FIXME("styleSheet is not our xmlnode implementation\n"); return E_FAIL; } - xsltSS = pxsltParseStylesheetDoc( pStyleSheet->node->doc); + xsltSS = pxsltParseStylesheetDoc(sheet->node->doc); if(xsltSS) { - result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL); + xmlDocPtr result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL); if(result) { - const xmlChar *pContent; + const xmlChar *content; if(result->type == XML_HTML_DOCUMENT_NODE) { - xmlOutputBufferPtr pOutput = xmlAllocOutputBuffer(NULL); - if(pOutput) + xmlOutputBufferPtr output = xmlAllocOutputBuffer(NULL); + if (output) { - htmlDocContentDumpOutput(pOutput, result->doc, NULL); - pContent = xmlBufferContent(pOutput->buffer); - *xmlString = bstr_from_xmlChar(pContent); - xmlOutputBufferClose(pOutput); + htmlDocContentDumpOutput(output, result->doc, NULL); + content = xmlBufferContent(output->buffer); + *p = bstr_from_xmlChar(content); + xmlOutputBufferClose(output); } } else { - xmlBufferPtr pXmlBuf; - int nSize; - - pXmlBuf = xmlBufferCreate(); - if(pXmlBuf) + xmlBufferPtr buf = xmlBufferCreate(); + if (buf) { - nSize = xmlNodeDump(pXmlBuf, NULL, (xmlNodePtr)result, 0, 0); - if(nSize > 0) + int size = xmlNodeDump(buf, NULL, (xmlNodePtr)result, 0, 0); + if(size > 0) { - pContent = xmlBufferContent(pXmlBuf); - *xmlString = bstr_from_xmlChar(pContent); + content = xmlBufferContent(buf); + *p = bstr_from_xmlChar(content); } - xmlBufferFree(pXmlBuf); + xmlBufferFree(buf); } } xmlFreeDoc(result); @@ -1022,8 +1010,7 @@ static HRESULT WINAPI xmlnode_transformNode( pxsltFreeStylesheet(xsltSS); } - if(*xmlString == NULL) - *xmlString = SysAllocStringLen(NULL, 0); + if(!*p) *p = SysAllocStringLen(NULL, 0); return S_OK; #else @@ -1148,7 +1135,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl = NULL, NULL, NULL, - xmlnode_transformNode, + NULL, NULL, NULL }; @@ -1612,7 +1599,7 @@ static HRESULT WINAPI unknode_transformNode( IXMLDOMNode* domNode, BSTR* p) { unknode *This = unknode_from_IXMLDOMNode( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + return node_transform_node(&This->node, domNode, p); } static HRESULT WINAPI unknode_selectNodes( diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index 72e0d819f02..6c5361a7b43 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -496,10 +496,11 @@ static HRESULT WINAPI dom_pi_get_xml( static HRESULT WINAPI dom_pi_transformNode( IXMLDOMProcessingInstruction *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI dom_pi_selectNodes( diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index cc0b8299f43..8036d32cda4 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -566,10 +566,11 @@ static HRESULT WINAPI domtext_get_xml( static HRESULT WINAPI domtext_transformNode( IXMLDOMText *iface, - IXMLDOMNode* domNode, BSTR* p) + IXMLDOMNode *node, BSTR *p) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_transformNode( &This->node.IXMLDOMNode_iface, domNode, p ); + TRACE("(%p)->(%p %p)\n", This, node, p); + return node_transform_node(&This->node, node, p); } static HRESULT WINAPI domtext_selectNodes(