Commit 6f95c699 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Added IMXAttributes::clear().

parent f9c3a51f
......@@ -1665,8 +1665,23 @@ static HRESULT WINAPI MXAttributes_addAttributeFromIndex(IMXAttributes *iface,
static HRESULT WINAPI MXAttributes_clear(IMXAttributes *iface)
{
mxattributes *This = impl_from_IMXAttributes( iface );
FIXME("(%p): stub\n", This);
return E_NOTIMPL;
int i;
TRACE("(%p)\n", This);
for (i = 0; i < This->length; i++)
{
SysFreeString(This->attr[i].qname);
SysFreeString(This->attr[i].local);
SysFreeString(This->attr[i].uri);
SysFreeString(This->attr[i].type);
SysFreeString(This->attr[i].value);
memset(&This->attr[i], 0, sizeof(mxattribute));
}
This->length = 0;
return S_OK;
}
static HRESULT WINAPI MXAttributes_removeAttribute(IMXAttributes *iface, int index)
......
......@@ -4068,6 +4068,9 @@ static void test_mxattr_clear(void)
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
EXPECT_HR(hr, E_INVALIDARG);
hr = IMXAttributes_clear(mxattr);
EXPECT_HR(hr, S_OK);
hr = IMXAttributes_addAttribute(mxattr, _bstr_("uri"), _bstr_("local"),
_bstr_("qname"), _bstr_("type"), _bstr_("value"));
EXPECT_HR(hr, S_OK);
......@@ -4094,23 +4097,20 @@ static void test_mxattr_clear(void)
ok(!lstrcmpW(ptr, _bstr_("qname")), "got %s\n", wine_dbgstr_w(ptr));
hr = IMXAttributes_clear(mxattr);
todo_wine
EXPECT_HR(hr, S_OK);
len = -1;
hr = ISAXAttributes_getLength(saxattr, &len);
EXPECT_HR(hr, S_OK);
todo_wine
ok(len == 0, "got %d\n", len);
len = -1;
ptr = (void*)0xdeadbeef;
hr = ISAXAttributes_getQName(saxattr, 0, &ptr, &len);
todo_wine {
EXPECT_HR(hr, E_INVALIDARG);
ok(len == -1, "got %d\n", len);
ok(ptr == (void*)0xdeadbeef, "got %p\n", ptr);
}
IMXAttributes_Release(mxattr);
ISAXAttributes_Release(saxattr);
free_bstrs();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment