msxml3: Fix get_namespaceURI() for document nodes.

This commit is contained in:
Nikolay Sivov 2011-11-27 22:36:32 +03:00 committed by Alexandre Julliard
parent 852bde49cb
commit 2508025bcd
2 changed files with 9 additions and 6 deletions

View File

@ -1369,17 +1369,15 @@ static HRESULT WINAPI domdoc_get_parsed(
return S_OK; return S_OK;
} }
static HRESULT WINAPI domdoc_get_namespaceURI( static HRESULT WINAPI domdoc_get_namespaceURI(
IXMLDOMDocument3 *iface, IXMLDOMDocument3 *iface,
BSTR* namespaceURI ) BSTR* namespaceURI )
{ {
domdoc *This = impl_from_IXMLDOMDocument3( iface ); domdoc *This = impl_from_IXMLDOMDocument3( iface );
TRACE("(%p)->(%p)\n", This, namespaceURI); TRACE("(%p)->(%p)\n", This, namespaceURI);
return node_get_namespaceURI(&This->node, namespaceURI); return return_null_bstr( namespaceURI );
} }
static HRESULT WINAPI domdoc_get_prefix( static HRESULT WINAPI domdoc_get_prefix(
IXMLDOMDocument3 *iface, IXMLDOMDocument3 *iface,
BSTR* prefix ) BSTR* prefix )

View File

@ -7137,6 +7137,11 @@ static void test_namespaces(void)
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
ok(b == VARIANT_TRUE, "got %d\n", b); ok(b == VARIANT_TRUE, "got %d\n", b);
str = (BSTR)0xdeadbeef;
hr = IXMLDOMDocument_get_namespaceURI(doc, &str);
EXPECT_HR(hr, S_FALSE);
ok(str == NULL, "got %p\n", str);
hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("//XMI.content"), &node ); hr = IXMLDOMDocument_selectSingleNode(doc, _bstr_("//XMI.content"), &node );
EXPECT_HR(hr, S_OK); EXPECT_HR(hr, S_OK);
if(hr == S_OK) if(hr == S_OK)
@ -8757,11 +8762,11 @@ static void test_get_prefix(void)
/* 1. document */ /* 1. document */
str = (void*)0xdeadbeef; str = (void*)0xdeadbeef;
hr = IXMLDOMDocument_get_prefix(doc, &str); hr = IXMLDOMDocument_get_prefix(doc, &str);
ok( hr == S_FALSE, "got 0x%08x\n", hr); EXPECT_HR(hr, S_FALSE);
ok( str == 0, "got %p\n", str); ok(str == NULL, "got %p\n", str);
hr = IXMLDOMDocument_get_prefix(doc, NULL); hr = IXMLDOMDocument_get_prefix(doc, NULL);
ok( hr == E_INVALIDARG, "got 0x%08x\n", hr); EXPECT_HR(hr, E_INVALIDARG);
/* 2. cdata */ /* 2. cdata */
hr = IXMLDOMDocument_createCDATASection(doc, NULL, &cdata); hr = IXMLDOMDocument_createCDATASection(doc, NULL, &cdata);