Alistair Leslie-Hughes : msxml3: Implement IXMLDOMText_appendData.

Alexandre Julliard julliard at winehq.org
Mon Mar 3 06:21:20 CST 2008


Module: wine
Branch: master
Commit: f9c5856c8c7f8710c1fc13a925b7fb8c225e98ce
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f9c5856c8c7f8710c1fc13a925b7fb8c225e98ce

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Sat Mar  1 22:32:58 2008 +1100

msxml3: Implement IXMLDOMText_appendData.

---

 dlls/msxml3/tests/domdoc.c |   15 +++++++++++++++
 dlls/msxml3/text.c         |   28 ++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index bf4046b..18f5c32 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -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 );
diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c
index 4821e63..b446052 100644
--- a/dlls/msxml3/text.c
+++ b/dlls/msxml3/text.c
@@ -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(




More information about the wine-cvs mailing list