Commit 675ed5a9 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Implement IXMLDOMCDATASection_appendData.

parent c7f3dfc1
......@@ -584,8 +584,32 @@ static HRESULT WINAPI domcdata_appendData(
IXMLDOMCDATASection *iface,
BSTR p)
{
FIXME("\n");
return E_NOTIMPL;
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
xmlChar *pContent;
HRESULT hr = S_FALSE;
TRACE("%p\n", iface);
/* Nothing to do if NULL or an Empty string passed in. */
if(p == NULL || SysStringLen(p) == 0)
return S_OK;
pContent = xmlChar_from_wchar( (WCHAR*)p );
if(pContent)
{
if(xmlTextConcat(pDOMNode->node, pContent, SysStringLen(p) ) == 0)
hr = S_OK;
else
{
hr = E_FAIL;
xmlFree(pContent);
}
}
else
hr = E_FAIL;
return hr;
}
static HRESULT WINAPI domcdata_insertData(
......
......@@ -2500,6 +2500,21 @@ static void test_xmlTypes(void)
ok( !lstrcmpW( str, _bstr_("\\") ), "incorrect substringData string\n");
SysFreeString(str);
/* test appendData */
hr = IXMLDOMCDATASection_appendData(pCDataSec, NULL);
ok(hr == S_OK, "ret %08x\n", hr );
hr = IXMLDOMCDATASection_appendData(pCDataSec, _bstr_(""));
ok(hr == S_OK, "ret %08x\n", hr );
hr = IXMLDOMCDATASection_appendData(pCDataSec, _bstr_("Append"));
ok(hr == S_OK, "ret %08x\n", hr );
hr = IXMLDOMCDATASection_get_text(pCDataSec, &str);
ok(hr == S_OK, "ret %08x\n", hr );
ok( !lstrcmpW( str, _bstr_("This &is a ; test <>\\Append") ), "incorrect get_text string\n");
SysFreeString(str);
IXMLDOMCDATASection_Release(pCDataSec);
}
......
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