Commit 2c389667 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Support VT_R8 in variant_to_nsstr.

parent d538e86a
......@@ -962,6 +962,21 @@ HRESULT variant_to_nsstr(VARIANT *v, BOOL hex_int, nsAString *nsstr)
nsAString_Init(nsstr, buf);
break;
case VT_R8: {
VARIANT strv;
HRESULT hres;
V_VT(&strv) = VT_EMPTY;
hres = VariantChangeTypeEx(&strv, v, MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT),
0, VT_BSTR);
if(FAILED(hres))
return hres;
nsAString_Init(nsstr, V_BSTR(&strv));
SysFreeString(V_BSTR(&strv));
break;
}
default:
FIXME("not implemented for %s\n", debugstr_variant(v));
return E_NOTIMPL;
......
......@@ -81,6 +81,8 @@ function test_textContent() {
ok(div.textContent === "", "div.textContent = " + div.textContent);
div.textContent = 11;
ok(div.textContent === "11", "div.textContent = " + div.textContent);
div.textContent = 10.5;
ok(div.textContent === "10.5", "div.textContent = " + div.textContent);
ok(document.textContent === null, "document.textContent = " + document.textContent);
......
......@@ -852,6 +852,16 @@ static void test_css_style_declaration(IHTMLCSSStyleDeclaration *css_style)
test_var_bstr(&v, "0");
VariantClear(&v);
V_VT(&v) = VT_R8;
V_R8(&v) = 0.5;
hres = IHTMLCSSStyleDeclaration_put_opacity(css_style, v);
ok(hres == S_OK, "put_opacity failed: %08x\n", hres);
hres = IHTMLCSSStyleDeclaration_get_opacity(css_style, &v);
ok(hres == S_OK, "get_opacity failed: %08x\n", hres);
test_var_bstr(&v, "0.5");
VariantClear(&v);
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("1");
hres = IHTMLCSSStyleDeclaration_put_opacity(css_style, v);
......
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