Jacek Caban : mshtml: Support VT_R8 in variant_to_nsstr.

Alexandre Julliard julliard at winehq.org
Fri Apr 19 17:30:46 CDT 2019


Module: wine
Branch: master
Commit: 2c389667295f014168a9b0bfa72a9511801eae15
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2c389667295f014168a9b0bfa72a9511801eae15

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Apr 19 16:37:32 2019 +0200

mshtml: Support VT_R8 in variant_to_nsstr.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/nsembed.c         | 15 +++++++++++++++
 dlls/mshtml/tests/elements.js |  2 ++
 dlls/mshtml/tests/style.c     | 10 ++++++++++
 3 files changed, 27 insertions(+)

diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index 08e6507..35e9bf0 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -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;
diff --git a/dlls/mshtml/tests/elements.js b/dlls/mshtml/tests/elements.js
index 4f0c802..320a2f6 100644
--- a/dlls/mshtml/tests/elements.js
+++ b/dlls/mshtml/tests/elements.js
@@ -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);
 
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index a7b4506..52a3a5c 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -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);




More information about the wine-cvs mailing list