Nikolay Sivov : msxml3: Fix IXMLDOMNode::get_namespaceURI() for empty URIs.
Alexandre Julliard
julliard at winehq.org
Tue Sep 14 17:35:25 CDT 2010
Module: wine
Branch: master
Commit: 4e94abd71007967f819249652ea0ac511b887418
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4e94abd71007967f819249652ea0ac511b887418
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Tue Sep 14 09:01:16 2010 +0400
msxml3: Fix IXMLDOMNode::get_namespaceURI() for empty URIs.
---
dlls/msxml3/node.c | 18 ++++++++----------
dlls/msxml3/tests/domdoc.c | 4 ++--
2 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c
index 7e91292..8f3ebc6 100644
--- a/dlls/msxml3/node.c
+++ b/dlls/msxml3/node.c
@@ -1402,8 +1402,7 @@ static HRESULT WINAPI xmlnode_get_namespaceURI(
BSTR* namespaceURI)
{
xmlnode *This = impl_from_IXMLDOMNode( iface );
- HRESULT hr = S_FALSE;
- xmlNsPtr *pNSList;
+ xmlNsPtr *ns;
TRACE("(%p)->(%p)\n", This, namespaceURI );
@@ -1412,16 +1411,15 @@ static HRESULT WINAPI xmlnode_get_namespaceURI(
*namespaceURI = NULL;
- pNSList = xmlGetNsList(This->node->doc, This->node);
- if(pNSList)
+ if ((ns = xmlGetNsList(This->node->doc, This->node)))
{
- *namespaceURI = bstr_from_xmlChar( pNSList[0]->href );
-
- xmlFree( pNSList );
- hr = S_OK;
+ if (ns[0]->href) *namespaceURI = bstr_from_xmlChar( ns[0]->href );
+ xmlFree(ns);
}
- return hr;
+ TRACE("uri: %s\n", debugstr_w(*namespaceURI));
+
+ return *namespaceURI ? S_OK : S_FALSE;
}
static HRESULT WINAPI xmlnode_get_prefix(
@@ -1444,7 +1442,7 @@ static HRESULT WINAPI xmlnode_get_prefix(
xmlFree(ns);
}
- TRACE("prefix %s\n", debugstr_w(*prefixString));
+ TRACE("prefix: %s\n", debugstr_w(*prefixString));
return *prefixString ? S_OK : S_FALSE;
}
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 176ff36..cd789e5 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -6163,8 +6163,8 @@ static void test_get_prefix(void)
str = (void*)0xdeadbeef;
hr = IXMLDOMElement_get_namespaceURI(element, &str);
- todo_wine ok( hr == S_FALSE, "got 0x%08x\n", hr);
- todo_wine ok( str == 0, "got %p\n", str);
+ ok( hr == S_FALSE, "got 0x%08x\n", hr);
+ ok( str == 0, "got %p\n", str);
IXMLDOMElement_Release(element);
More information about the wine-cvs
mailing list