mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 11:43:31 +00:00
msxml3: Handle default namespace in get_nodeName.
This commit is contained in:
parent
b9e8a742b7
commit
4e1a3cc81e
3 changed files with 18 additions and 6 deletions
|
@ -186,6 +186,13 @@ HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
|
|||
hr = node_get_base_name(This, &base);
|
||||
if (hr != S_OK) return hr;
|
||||
|
||||
if (!base[0] && xmldoc_version(This->node->doc) != MSXML6)
|
||||
{
|
||||
SysFreeString(base);
|
||||
*name = SysAllocString(L"xmlns");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
hr = node_get_prefix(This, &prefix);
|
||||
if (hr == S_OK)
|
||||
{
|
||||
|
@ -194,10 +201,17 @@ HRESULT node_get_nodeName(xmlnode *This, BSTR *name)
|
|||
|
||||
/* +1 for ':' */
|
||||
ptr = *name = SysAllocStringLen(NULL, SysStringLen(base) + SysStringLen(prefix) + 1);
|
||||
memcpy(ptr, prefix, SysStringByteLen(prefix));
|
||||
ptr += SysStringLen(prefix);
|
||||
memcpy(ptr++, &colW, sizeof(WCHAR));
|
||||
memcpy(ptr, base, SysStringByteLen(base));
|
||||
if (SysStringByteLen(prefix))
|
||||
{
|
||||
memcpy(ptr, prefix, SysStringByteLen(prefix));
|
||||
ptr += SysStringLen(prefix);
|
||||
}
|
||||
if (SysStringByteLen(base))
|
||||
{
|
||||
if (SysStringByteLen(prefix))
|
||||
memcpy(ptr++, &colW, sizeof(WCHAR));
|
||||
memcpy(ptr, base, SysStringByteLen(base));
|
||||
}
|
||||
|
||||
SysFreeString(base);
|
||||
SysFreeString(prefix);
|
||||
|
|
|
@ -13778,7 +13778,6 @@ static void test_namespaces_as_attributes(void)
|
|||
str = NULL;
|
||||
hr = IXMLDOMNode_get_nodeName(item, &str);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
todo_wine_if(test->todo)
|
||||
ok(!lstrcmpW(str, _bstr_(test->names[i])), "got %s\n", wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
|
||||
|
|
|
@ -261,7 +261,6 @@ static void test_namespaces_as_attributes(void)
|
|||
str = NULL;
|
||||
hr = IXMLDOMNode_get_nodeName(item, &str);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
todo_wine_if(test->todo)
|
||||
ok(!lstrcmpW(str, test->names[i]), "got %s\n", wine_dbgstr_w(str));
|
||||
SysFreeString(str);
|
||||
|
||||
|
|
Loading…
Reference in a new issue