[PATCH 2/4] Remove selectSingleNode() forward

Nikolay Sivov nsivov at codeweavers.com
Wed Feb 23 05:44:20 CST 2011


---
 dlls/msxml3/attribute.c     |    3 ++-
 dlls/msxml3/cdata.c         |    3 ++-
 dlls/msxml3/comment.c       |    3 ++-
 dlls/msxml3/docfrag.c       |    3 ++-
 dlls/msxml3/domdoc.c        |    7 ++++---
 dlls/msxml3/element.c       |    3 ++-
 dlls/msxml3/entityref.c     |    3 ++-
 dlls/msxml3/msxml_private.h |    1 +
 dlls/msxml3/node.c          |   22 ++++++++--------------
 dlls/msxml3/pi.c            |    3 ++-
 dlls/msxml3/text.c          |    3 ++-
 11 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c
index bb686bf..b0c9586 100644
--- a/dlls/msxml3/attribute.c
+++ b/dlls/msxml3/attribute.c
@@ -492,7 +492,8 @@ static HRESULT WINAPI domattr_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domattr_get_parsed(
diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c
index f30b832..be4513d 100644
--- a/dlls/msxml3/cdata.c
+++ b/dlls/msxml3/cdata.c
@@ -503,7 +503,8 @@ static HRESULT WINAPI domcdata_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domcdata_get_parsed(
diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c
index a77399c..f48660d 100644
--- a/dlls/msxml3/comment.c
+++ b/dlls/msxml3/comment.c
@@ -496,7 +496,8 @@ static HRESULT WINAPI domcomment_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domcomment_get_parsed(
diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c
index 756a160..72d8f57 100644
--- a/dlls/msxml3/docfrag.c
+++ b/dlls/msxml3/docfrag.c
@@ -500,7 +500,8 @@ static HRESULT WINAPI domfrag_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domfrag_get_parsed(
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index b1e47cd..9596601 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -1449,11 +1449,12 @@ static HRESULT WINAPI domdoc_selectNodes(
 
 static HRESULT WINAPI domdoc_selectSingleNode(
     IXMLDOMDocument3 *iface,
-    BSTR queryString,
-    IXMLDOMNode** resultNode )
+    BSTR p,
+    IXMLDOMNode **outNode)
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, queryString, resultNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c
index f007ead..9a29427 100644
--- a/dlls/msxml3/element.c
+++ b/dlls/msxml3/element.c
@@ -952,7 +952,8 @@ static HRESULT WINAPI domelem_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domelem_get_parsed(
diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c
index acb050b..d103609 100644
--- a/dlls/msxml3/entityref.c
+++ b/dlls/msxml3/entityref.c
@@ -494,7 +494,8 @@ static HRESULT WINAPI entityref_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI entityref_get_parsed(
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index b3a3524..b74c905 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -277,6 +277,7 @@ extern HRESULT node_has_childnodes(const xmlnode*,VARIANT_BOOL*);
 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 get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);
 
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index c1ebbc2..435ae03 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -1023,24 +1023,18 @@ HRESULT node_select_nodes(const xmlnode *This, BSTR query, IXMLDOMNodeList **nod
     return hr;
 }
 
-static HRESULT WINAPI xmlnode_selectSingleNode(
-    IXMLDOMNode *iface,
-    BSTR queryString,
-    IXMLDOMNode** resultNode)
+HRESULT node_select_singlenode(const xmlnode *This, BSTR query, IXMLDOMNode **node)
 {
-    xmlnode *This = impl_from_IXMLDOMNode( iface );
     IXMLDOMNodeList *list;
-    HRESULT r;
-
-    TRACE("(%p)->(%s %p)\n", This, debugstr_w(queryString), resultNode );
+    HRESULT hr;
 
-    r = IXMLDOMNode_selectNodes(This->iface, queryString, &list);
-    if(r == S_OK)
+    hr = node_select_nodes(This, query, &list);
+    if (hr == S_OK)
     {
-        r = IXMLDOMNodeList_nextNode(list, resultNode);
+        hr = IXMLDOMNodeList_nextNode(list, node);
         IXMLDOMNodeList_Release(list);
     }
-    return r;
+    return hr;
 }
 
 HRESULT node_get_namespaceURI(xmlnode *This, BSTR *namespaceURI)
@@ -1133,7 +1127,7 @@ static const struct IXMLDOMNodeVtbl xmlnode_vtbl =
     NULL,
     xmlnode_transformNode,
     NULL,
-    xmlnode_selectSingleNode
+    NULL
 };
 
 void destroy_xmlnode(xmlnode *This)
@@ -1611,7 +1605,7 @@ static HRESULT WINAPI unknode_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     unknode *This = unknode_from_IXMLDOMNode( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI unknode_get_parsed(
diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c
index cadfa04..3bea6c6 100644
--- a/dlls/msxml3/pi.c
+++ b/dlls/msxml3/pi.c
@@ -511,7 +511,8 @@ static HRESULT WINAPI dom_pi_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI dom_pi_get_parsed(
diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c
index 1904678..7d43002 100644
--- a/dlls/msxml3/text.c
+++ b/dlls/msxml3/text.c
@@ -581,7 +581,8 @@ static HRESULT WINAPI domtext_selectSingleNode(
     BSTR p, IXMLDOMNode** outNode)
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-    return IXMLDOMNode_selectSingleNode( &This->node.IXMLDOMNode_iface, p, outNode );
+    TRACE("(%p)->(%s %p)\n", This, debugstr_w(p), outNode);
+    return node_select_singlenode(&This->node, p, outNode);
 }
 
 static HRESULT WINAPI domtext_get_parsed(
-- 
1.5.6.5



--------------040701000600020309030200--



More information about the wine-patches mailing list