Commit b8282638 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

msxml3: Use interface methods for ::get_length() calls.

parent 3afa6576
......@@ -480,7 +480,7 @@ static HRESULT WINAPI domcdata_get_data(
BSTR *p)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
HRESULT hr = E_FAIL;
HRESULT hr;
VARIANT vRet;
if(!p)
......@@ -500,7 +500,6 @@ static HRESULT WINAPI domcdata_put_data(
BSTR data)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
HRESULT hr = E_FAIL;
VARIANT val;
TRACE("%p %s\n", This, debugstr_w(data) );
......@@ -508,9 +507,7 @@ static HRESULT WINAPI domcdata_put_data(
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
return hr;
return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domcdata_get_length(
......@@ -518,23 +515,21 @@ static HRESULT WINAPI domcdata_get_length(
LONG *len)
{
domcdata *This = impl_from_IXMLDOMCDATASection( iface );
xmlChar *pContent;
LONG nLength = 0;
HRESULT hr;
BSTR data;
TRACE("%p\n", iface);
TRACE("%p %p\n", This, len);
if(!len)
return E_INVALIDARG;
pContent = xmlNodeGetContent(This->node.node);
if(pContent)
hr = IXMLDOMCDATASection_get_data(iface, &data);
if(hr == S_OK)
{
nLength = xmlStrlen(pContent);
xmlFree(pContent);
*len = SysStringLen(data);
SysFreeString(data);
}
*len = nLength;
return S_OK;
}
......
......@@ -474,7 +474,7 @@ static HRESULT WINAPI domcomment_get_data(
BSTR *p)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
HRESULT hr = E_FAIL;
HRESULT hr;
VARIANT vRet;
if(!p)
......@@ -494,7 +494,6 @@ static HRESULT WINAPI domcomment_put_data(
BSTR data)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
HRESULT hr = E_FAIL;
VARIANT val;
TRACE("%p %s\n", This, debugstr_w(data) );
......@@ -502,9 +501,7 @@ static HRESULT WINAPI domcomment_put_data(
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
return hr;
return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domcomment_get_length(
......@@ -512,24 +509,22 @@ static HRESULT WINAPI domcomment_get_length(
LONG *len)
{
domcomment *This = impl_from_IXMLDOMComment( iface );
xmlChar *pContent;
LONG nLength = 0;
HRESULT hr;
BSTR data;
TRACE("%p\n", iface);
TRACE("%p %p\n", This, len);
if(!len)
return E_INVALIDARG;
pContent = xmlNodeGetContent(This->node.node);
if(pContent)
hr = IXMLDOMComment_get_data(iface, &data);
if(hr == S_OK)
{
nLength = xmlStrlen(pContent);
xmlFree(pContent);
*len = SysStringLen(data);
SysFreeString(data);
}
*len = nLength;
return S_OK;
return hr;
}
static HRESULT WINAPI domcomment_substringData(
......
......@@ -482,7 +482,7 @@ static HRESULT WINAPI domtext_get_data(
BSTR *p)
{
domtext *This = impl_from_IXMLDOMText( iface );
HRESULT hr = E_FAIL;
HRESULT hr;
VARIANT vRet;
if(!p)
......@@ -502,7 +502,6 @@ static HRESULT WINAPI domtext_put_data(
BSTR data)
{
domtext *This = impl_from_IXMLDOMText( iface );
HRESULT hr = E_FAIL;
VARIANT val;
TRACE("%p %s\n", This, debugstr_w(data) );
......@@ -510,9 +509,7 @@ static HRESULT WINAPI domtext_put_data(
V_VT(&val) = VT_BSTR;
V_BSTR(&val) = data;
hr = IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
return hr;
return IXMLDOMNode_put_nodeValue( IXMLDOMNode_from_impl(&This->node), val );
}
static HRESULT WINAPI domtext_get_length(
......@@ -520,24 +517,22 @@ static HRESULT WINAPI domtext_get_length(
LONG *len)
{
domtext *This = impl_from_IXMLDOMText( iface );
xmlChar *pContent;
LONG nLength = 0;
HRESULT hr;
BSTR data;
TRACE("%p\n", iface);
TRACE("%p %p\n", This, len);
if(!len)
return E_INVALIDARG;
pContent = xmlNodeGetContent(This->node.node);
if(pContent)
hr = IXMLDOMText_get_data(iface, &data);
if(hr == S_OK)
{
nLength = xmlStrlen(pContent);
xmlFree(pContent);
*len = SysStringLen(data);
SysFreeString(data);
}
*len = nLength;
return S_OK;
return hr;
}
static HRESULT WINAPI domtext_substringData(
......@@ -595,8 +590,7 @@ static HRESULT WINAPI domtext_appendData(
TRACE("%p\n", iface);
/* Nothing to do if NULL or an Empty string passed in. */
if(p == NULL || SysStringLen(p) == 0)
return S_OK;
if(SysStringLen(p) == 0) return S_OK;
pContent = xmlChar_from_wchar( p );
if(pContent)
......@@ -624,7 +618,7 @@ static HRESULT WINAPI domtext_insertData(
LONG nLength = 0, nLengthP = 0;
xmlChar *str = NULL;
TRACE("%p\n", This);
TRACE("%p %d %s\n", This, offset, debugstr_w(p));
/* If have a NULL or empty string, don't do anything. */
if(SysStringLen(p) == 0)
......
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