msxml3: Fix a couple incorrect uses of VariantChangeType().

This commit is contained in:
Adam Martinson 2011-06-20 00:25:12 -05:00 committed by Alexandre Julliard
parent 809dd1a0a2
commit 5ab513bd9e
2 changed files with 13 additions and 10 deletions

View File

@ -761,21 +761,24 @@ static HRESULT WINAPI domelem_put_nodeTypedValue(
VARIANT value) VARIANT value)
{ {
domelem *This = impl_from_IXMLDOMElement( iface ); domelem *This = impl_from_IXMLDOMElement( iface );
VARIANT type; XDR_DT dt;
HRESULT hr; HRESULT hr;
TRACE("(%p)->(%s)\n", This, debugstr_variant(&value)); TRACE("(%p)->(%s)\n", This, debugstr_variant(&value));
dt = element_get_dt(get_element(This));
/* for untyped node coerce to BSTR and set */ /* for untyped node coerce to BSTR and set */
if (IXMLDOMElement_get_dataType(iface, &type) == S_FALSE) if (dt == DT_INVALID)
{ {
if (V_VT(&value) != VT_BSTR) if (V_VT(&value) != VT_BSTR)
{ {
hr = VariantChangeType(&value, &value, 0, VT_BSTR); VARIANT content;
VariantInit(&content);
hr = VariantChangeType(&content, &value, 0, VT_BSTR);
if (hr == S_OK) if (hr == S_OK)
{ {
hr = node_set_content(&This->node, V_BSTR(&value)); hr = node_set_content(&This->node, V_BSTR(&content));
VariantClear(&value); VariantClear(&content);
} }
} }
else else
@ -783,8 +786,7 @@ static HRESULT WINAPI domelem_put_nodeTypedValue(
} }
else else
{ {
FIXME("not implemented for typed nodes. type %s\n", debugstr_w(V_BSTR(&value))); FIXME("not implemented for dt:%s\n", dt_to_str(dt));
VariantClear(&type);
return E_NOTIMPL; return E_NOTIMPL;
} }

View File

@ -666,7 +666,7 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR
{ {
httprequest *This = impl_from_IXMLHTTPRequest( iface ); httprequest *This = impl_from_IXMLHTTPRequest( iface );
HRESULT hr; HRESULT hr;
VARIANT str; VARIANT str, is_async;
TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(method), debugstr_w(url), TRACE("(%p)->(%s %s %s)\n", This, debugstr_w(method), debugstr_w(url),
debugstr_variant(&async)); debugstr_variant(&async));
@ -700,8 +700,9 @@ static HRESULT WINAPI httprequest_open(IXMLHTTPRequest *iface, BSTR method, BSTR
This->url = SysAllocString(url); This->url = SysAllocString(url);
hr = VariantChangeType(&async, &async, 0, VT_BOOL); VariantInit(&is_async);
This->async = hr == S_OK && V_BOOL(&async) == VARIANT_TRUE; hr = VariantChangeType(&is_async, &async, 0, VT_BOOL);
This->async = hr == S_OK && V_BOOL(&is_async) == VARIANT_TRUE;
VariantInit(&str); VariantInit(&str);
hr = VariantChangeType(&str, &user, 0, VT_BSTR); hr = VariantChangeType(&str, &user, 0, VT_BSTR);