msxml3: Implement IXMLDOMText_appendData.

This commit is contained in:
Alistair Leslie-Hughes 2008-03-01 22:32:58 +11:00 committed by Alexandre Julliard
parent 9238ccca48
commit f9c5856c8c
2 changed files with 41 additions and 2 deletions

View File

@ -638,6 +638,21 @@ static void test_domdoc( void )
ok( !lstrcmpW( str, _bstr_("\\") ), "incorrect substringData string\n");
SysFreeString(str);
/* test appendData */
r = IXMLDOMText_appendData(nodetext, NULL);
ok(r == S_OK, "ret %08x\n", r );
r = IXMLDOMText_appendData(nodetext, _bstr_(""));
ok(r == S_OK, "ret %08x\n", r );
r = IXMLDOMText_appendData(nodetext, _bstr_("Append"));
ok(r == S_OK, "ret %08x\n", r );
r = IXMLDOMText_get_text(nodetext, &str);
ok(r == S_OK, "ret %08x\n", r );
ok( !lstrcmpW( str, _bstr_("This &is a ; test <>\\Append") ), "incorrect get_text string\n");
SysFreeString(str);
IXMLDOMText_Release( nodetext );
}
SysFreeString( str );

View File

@ -584,8 +584,32 @@ static HRESULT WINAPI domtext_appendData(
IXMLDOMText *iface,
BSTR p)
{
FIXME("\n");
return E_NOTIMPL;
domtext *This = impl_from_IXMLDOMText( 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 domtext_insertData(