Alistair Leslie-Hughes : msxml3: Implement IXMLDOMCDATASection_get_length.

Alexandre Julliard julliard at winehq.org
Wed Feb 27 08:03:01 CST 2008


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

Author: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
Date:   Tue Feb 26 20:21:43 2008 +1100

msxml3: Implement IXMLDOMCDATASection_get_length.

---

 dlls/msxml3/cdata.c        |   22 ++++++++++++++++++++--
 dlls/msxml3/tests/domdoc.c |    5 +++++
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c
index e9203b1..ce25bd8 100644
--- a/dlls/msxml3/cdata.c
+++ b/dlls/msxml3/cdata.c
@@ -501,8 +501,26 @@ static HRESULT WINAPI domcdata_get_length(
     IXMLDOMCDATASection *iface,
     long *len)
 {
-    FIXME("\n");
-    return E_NOTIMPL;
+    domcdata *This = impl_from_IXMLDOMCDATASection( iface );
+    xmlnode *pDOMNode = impl_from_IXMLDOMNode( (IXMLDOMNode*)This->element );
+    xmlChar *pContent;
+    long nLength = 0;
+
+    TRACE("%p\n", iface);
+
+    if(!len)
+        return E_INVALIDARG;
+
+    pContent = xmlNodeGetContent(pDOMNode->node);
+    if(pContent)
+    {
+        nLength = xmlStrlen(pContent);
+        xmlFree(pContent);
+    }
+
+    *len = nLength;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI domcdata_substringData(
diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c
index 11fe378..efaae79 100644
--- a/dlls/msxml3/tests/domdoc.c
+++ b/dlls/msxml3/tests/domdoc.c
@@ -2315,6 +2315,11 @@ static void test_xmlTypes(void)
                 ok( !lstrcmpW( str, _bstr_("This &is a ; test <>\\") ), "incorrect text string\n");
                 SysFreeString(str);
 
+                /* test length property */
+                hr = IXMLDOMCDATASection_get_length(pComment, &len);
+                ok(hr == S_OK, "ret %08x\n", hr );
+                ok(len == 21, "expected 21 got %ld\n", len);
+
                 IXMLDOMCDATASection_Release(pCDataSec);
             }
 




More information about the wine-cvs mailing list