Signed-off-by: Hans Leidekker hans@codeweavers.com --- dlls/msxml3/element.c | 1 + dlls/msxml3/tests/domdoc.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 0ff26e4fb7..ecebd39fea 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -847,6 +847,7 @@ static HRESULT WINAPI domelem_put_nodeTypedValue( { /* for untyped node coerce to BSTR and set */ case DT_INVALID: + case DT_INT: if (V_VT(&value) != VT_BSTR) { VARIANT content; diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index a6acdba366..49768b8dbe 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -8541,6 +8541,33 @@ static void test_put_nodeTypedValue(void) "got %s, expected "1"\n", wine_dbgstr_w(V_BSTR(&type))); VariantClear(&type);
+ /* int */ + hr = IXMLDOMElement_put_dataType(elem, _bstr_("int")); + EXPECT_HR(hr, S_OK); + + V_VT(&value) = VT_BSTR; + V_BSTR(&value) = _bstr_("1"); + hr = IXMLDOMElement_put_nodeTypedValue(elem, value); + EXPECT_HR(hr, S_OK); + VariantClear(&value); + + V_VT(&value) = VT_EMPTY; + hr = IXMLDOMElement_get_nodeTypedValue(elem, &value); + EXPECT_HR(hr, S_OK); + ok(V_VT(&value) == VT_I4, "got %d\n", V_VT(&value)); + ok(V_I4(&value) == 1, "got %d\n", V_I4(&value)); + + V_VT(&value) = VT_I2; + V_I2(&value) = -1; + hr = IXMLDOMElement_put_nodeTypedValue(elem, value); + EXPECT_HR(hr, S_OK); + + V_VT(&value) = VT_EMPTY; + hr = IXMLDOMElement_get_nodeTypedValue(elem, &value); + EXPECT_HR(hr, S_OK); + ok(V_VT(&value) == VT_I4, "got %d\n", V_VT(&value)); + ok(V_I4(&value) == -1, "got %d\n", V_I4(&value)); + hr = IXMLDOMElement_get_firstChild(elem, &node); EXPECT_HR(hr, S_OK); hr = IXMLDOMElement_removeChild(elem, node, NULL);