Module: wine Branch: master Commit: 9b3234eb359cc6a2c738a649f936f54021a03c35 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9b3234eb359cc6a2c738a649f9...
Author: Alistair Leslie-Hughes leslie_alistair@hotmail.com Date: Thu Mar 13 21:19:24 2008 +1100
msxml3: Implement IXMLDOMComment_appendData.
---
dlls/msxml3/comment.c | 28 ++++++++++++++++++++++++++-- dlls/msxml3/tests/domdoc.c | 15 +++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index be2beb2..3229465 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -583,8 +583,32 @@ static HRESULT WINAPI domcomment_appendData( IXMLDOMComment *iface, BSTR p) { - FIXME("\n"); - return E_NOTIMPL; + domcomment *This = impl_from_IXMLDOMComment( iface ); + xmlnode *pDOMNode = impl_from_IXMLDOMNode( This->node ); + 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 domcomment_insertData( diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 884c133..fef4d73 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -2283,6 +2283,21 @@ static void test_xmlTypes(void) ok( !lstrcmpW( str, _bstr_("\") ), "incorrect substringData string\n"); SysFreeString(str);
+ /* test appendData */ + hr = IXMLDOMComment_appendData(pComment, NULL); + ok(hr == S_OK, "ret %08x\n", hr ); + + hr = IXMLDOMComment_appendData(pComment, _bstr_("")); + ok(hr == S_OK, "ret %08x\n", hr ); + + hr = IXMLDOMComment_appendData(pComment, _bstr_("Append")); + ok(hr == S_OK, "ret %08x\n", hr ); + + hr = IXMLDOMComment_get_text(pComment, &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); + IXMLDOMComment_Release(pComment); }