Commit 72e70a01 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

msxml3: Implement IXMLDOMText length property.

parent e2ac47a4
......@@ -366,6 +366,7 @@ static void test_domdoc( void )
VARIANT var;
BSTR str;
long code;
long nLength = 0;
r = CoCreateInstance( &CLSID_DOMDocument, NULL,
CLSCTX_INPROC_SERVER, &IID_IXMLDOMDocument, (LPVOID*)&doc );
......@@ -554,6 +555,14 @@ static void test_domdoc( void )
ok( V_VT(&var) == VT_NULL, "incorrect dataType type\n");
VariantClear(&var);
/* test length property */
r = IXMLDOMText_get_length(nodetext, NULL);
ok(r == E_INVALIDARG, "ret %08x\n", r );
r = IXMLDOMText_get_length(nodetext, &nLength);
ok(r == S_OK, "ret %08x\n", r );
ok(nLength == 4, "expected 4 got %ld\n", nLength);
/* test nodeTypeString */
r = IXMLDOMText_get_nodeTypeString(nodetext, &str);
ok(r == S_OK, "ret %08x\n", r );
......
......@@ -491,8 +491,26 @@ static HRESULT WINAPI domtext_get_length(
IXMLDOMText *iface,
long *len)
{
FIXME("\n");
return E_NOTIMPL;
domtext *This = impl_from_IXMLDOMText( 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 domtext_substringData(
......
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