Jacek Caban : msxml3: Don't use xmlnode' s IXMLDOMNode iface in get_childNode implementations.

Alexandre Julliard julliard at winehq.org
Wed Sep 8 13:32:13 CDT 2010


Module: wine
Branch: master
Commit: c8b15e90bd2eb17c99885a148a15dae8f2e3e946
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c8b15e90bd2eb17c99885a148a15dae8f2e3e946

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Sep  8 15:12:02 2010 +0200

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

---

 dlls/msxml3/attribute.c     |    5 ++++-
 dlls/msxml3/cdata.c         |    5 ++++-
 dlls/msxml3/comment.c       |    5 ++++-
 dlls/msxml3/docfrag.c       |    5 ++++-
 dlls/msxml3/domdoc.c        |    5 ++++-
 dlls/msxml3/element.c       |    5 ++++-
 dlls/msxml3/entityref.c     |    5 ++++-
 dlls/msxml3/msxml_private.h |    2 ++
 dlls/msxml3/node.c          |   27 ++++++++++++++++-----------
 dlls/msxml3/pi.c            |    5 ++++-
 dlls/msxml3/text.c          |    5 ++++-
 11 files changed, 54 insertions(+), 20 deletions(-)

diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c
index aa0f2d0..9a0394d 100644
--- a/dlls/msxml3/attribute.c
+++ b/dlls/msxml3/attribute.c
@@ -238,7 +238,10 @@ static HRESULT WINAPI domattr_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domattr *This = impl_from_IXMLDOMAttribute( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domattr_get_firstChild(
diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c
index 56c2695..902fe26 100644
--- a/dlls/msxml3/cdata.c
+++ b/dlls/msxml3/cdata.c
@@ -249,7 +249,10 @@ static HRESULT WINAPI domcdata_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domcdata *This = impl_from_IXMLDOMCDATASection( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domcdata_get_firstChild(
diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c
index 3a30d6c..8763864 100644
--- a/dlls/msxml3/comment.c
+++ b/dlls/msxml3/comment.c
@@ -242,7 +242,10 @@ static HRESULT WINAPI domcomment_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domcomment *This = impl_from_IXMLDOMComment( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domcomment_get_firstChild(
diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c
index 5bc8e4b..ed8b6c5 100644
--- a/dlls/msxml3/docfrag.c
+++ b/dlls/msxml3/docfrag.c
@@ -244,7 +244,10 @@ static HRESULT WINAPI domfrag_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domfrag *This = impl_from_IXMLDOMDocumentFragment( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domfrag_get_firstChild(
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index f2a7ad6..f7400f4 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -752,7 +752,10 @@ static HRESULT WINAPI domdoc_get_childNodes(
     IXMLDOMNodeList** childList )
 {
     domdoc *This = impl_from_IXMLDOMDocument3( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), childList );
+
+    TRACE("(%p)->(%p)\n", This, childList);
+
+    return node_get_child_nodes(&This->node, childList);
 }
 
 
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c
index 3d6228d..c7c8d45 100644
--- a/dlls/msxml3/element.c
+++ b/dlls/msxml3/element.c
@@ -253,7 +253,10 @@ static HRESULT WINAPI domelem_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domelem *This = impl_from_IXMLDOMElement( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domelem_get_firstChild(
diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c
index 9fb9ab3..3b8ae53 100644
--- a/dlls/msxml3/entityref.c
+++ b/dlls/msxml3/entityref.c
@@ -240,7 +240,10 @@ static HRESULT WINAPI entityref_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     entityref *This = impl_from_IXMLDOMEntityReference( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI entityref_get_firstChild(
diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index f54e9ae..8964818 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -163,6 +163,8 @@ extern HRESULT node_get_nodeName(xmlnode*,BSTR*);
 extern HRESULT node_get_content(xmlnode*,VARIANT*);
 extern HRESULT node_put_value(xmlnode*,VARIANT*);
 extern HRESULT node_get_parent(xmlnode*,IXMLDOMNode**);
+extern HRESULT node_get_child_nodes(xmlnode*,IXMLDOMNodeList**);
+
 
 extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document);
 
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index 7bcbe12..aa494c4 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -293,24 +293,26 @@ static HRESULT WINAPI xmlnode_get_parentNode(
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI xmlnode_get_childNodes(
-    IXMLDOMNode *iface,
-    IXMLDOMNodeList** childList)
+HRESULT node_get_child_nodes(xmlnode *This, IXMLDOMNodeList **ret)
 {
-    xmlnode *This = impl_from_IXMLDOMNode( iface );
-
-    TRACE("(%p)->(%p)\n", This, childList );
-
-    if ( !childList )
+    if(!ret)
         return E_INVALIDARG;
 
-    *childList = create_children_nodelist(This->node);
-    if (*childList == NULL)
+    *ret = create_children_nodelist(This->node);
+    if(!*ret)
         return E_OUTOFMEMORY;
 
     return S_OK;
 }
 
+static HRESULT WINAPI xmlnode_get_childNodes(
+    IXMLDOMNode *iface,
+    IXMLDOMNodeList** childList)
+{
+    ERR("Should not be called\n");
+    return E_NOTIMPL;
+}
+
 static HRESULT WINAPI xmlnode_get_firstChild(
     IXMLDOMNode *iface,
     IXMLDOMNode** firstChild)
@@ -1825,7 +1827,10 @@ static HRESULT WINAPI unknode_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     unknode *This = impl_from_unkIXMLDOMNode( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI unknode_get_firstChild(
diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c
index 95f3327..20e6bd6 100644
--- a/dlls/msxml3/pi.c
+++ b/dlls/msxml3/pi.c
@@ -255,7 +255,10 @@ static HRESULT WINAPI dom_pi_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI dom_pi_get_firstChild(
diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c
index 48801d6..5891814 100644
--- a/dlls/msxml3/text.c
+++ b/dlls/msxml3/text.c
@@ -255,7 +255,10 @@ static HRESULT WINAPI domtext_get_childNodes(
     IXMLDOMNodeList** outList)
 {
     domtext *This = impl_from_IXMLDOMText( iface );
-    return IXMLDOMNode_get_childNodes( IXMLDOMNode_from_impl(&This->node), outList );
+
+    TRACE("(%p)->(%p)\n", This, outList);
+
+    return node_get_child_nodes(&This->node, outList);
 }
 
 static HRESULT WINAPI domtext_get_firstChild(




More information about the wine-cvs mailing list