From 6f537c4df11b70d2cb8338035557e694ac8f8cb8 Mon Sep 17 00:00:00 2001 From: Adam Martinson Date: Mon, 22 Nov 2010 20:57:58 -0600 Subject: [PATCH] msxml3: Implement domtext dt-related functions. These should always be handled by the parent node. --- dlls/msxml3/node.c | 2 +- dlls/msxml3/text.c | 94 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 88 insertions(+), 8 deletions(-) diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index c135f208303..2db71155e0b 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -852,7 +852,7 @@ static HRESULT WINAPI xmlnode_get_nodeTypedValue( V_VT(typedValue) = VT_NULL; - if (This->node->type == XML_TEXT_NODE || This->node->type == XML_ENTITY_REF_NODE) + if (This->node->type == XML_ENTITY_REF_NODE) { VariantInit(&type); hres = IXMLDOMNode_get_dataType(This->iface, &type); diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index 9b25008e301..76d81c27359 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -435,7 +435,29 @@ static HRESULT WINAPI domtext_get_nodeTypedValue( VARIANT* var1) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_get_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 ); + IXMLDOMNode* parent = NULL; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, var1); + + if (!var1) + return E_INVALIDARG; + + hr = domtext_get_parentNode(iface, &parent); + + if (hr == S_OK) + { + hr = IXMLDOMNode_get_nodeTypedValue(parent, var1); + IXMLDOMNode_Release(parent); + } + else + { + V_VT(var1) = VT_NULL; + V_BSTR(var1) = NULL; + hr = S_FALSE; + } + + return hr; } static HRESULT WINAPI domtext_put_nodeTypedValue( @@ -443,24 +465,82 @@ static HRESULT WINAPI domtext_put_nodeTypedValue( VARIANT var1) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_put_nodeTypedValue( IXMLDOMNode_from_impl(&This->node), var1 ); + IXMLDOMNode* parent = NULL; + HRESULT hr; + + TRACE("(%p)->(VARIANT)\n", This); + + hr = domtext_get_parentNode(iface, &parent); + + if (hr == S_OK) + { + hr = IXMLDOMNode_put_nodeTypedValue(parent, var1); + IXMLDOMNode_Release(parent); + } + else + { + hr = S_FALSE; + } + + return hr; } static HRESULT WINAPI domtext_get_dataType( IXMLDOMText *iface, - VARIANT* typename) + VARIANT* dtName) { domtext *This = impl_from_IXMLDOMText( iface ); - TRACE("(%p)->(%p)\n", This, typename); - return return_null_var( typename ); + IXMLDOMNode* parent = NULL; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, dtName); + + if (!dtName) + return E_INVALIDARG; + + hr = domtext_get_parentNode(iface, &parent); + + if (hr == S_OK) + { + hr = IXMLDOMNode_get_dataType(parent, dtName); + IXMLDOMNode_Release(parent); + } + else + { + V_VT(dtName) = VT_NULL; + V_BSTR(dtName) = NULL; + hr = S_FALSE; + } + + return hr; } static HRESULT WINAPI domtext_put_dataType( IXMLDOMText *iface, - BSTR p) + BSTR dtName) { domtext *This = impl_from_IXMLDOMText( iface ); - return IXMLDOMNode_put_dataType( IXMLDOMNode_from_impl(&This->node), p ); + IXMLDOMNode* parent = NULL; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, dtName); + + if (!dtName) + return E_INVALIDARG; + + hr = domtext_get_parentNode(iface, &parent); + + if (hr == S_OK) + { + hr = IXMLDOMNode_put_dataType(parent, dtName); + IXMLDOMNode_Release(parent); + } + else + { + hr = S_FALSE; + } + + return hr; } static HRESULT WINAPI domtext_get_xml(