Jacek Caban : mshtml: Use set_nsstyle_attr_var in IHTMLStyle:: put_height implementation.

Alexandre Julliard julliard at winehq.org
Mon Nov 14 13:33:57 CST 2011


Module: wine
Branch: master
Commit: 6f9e67e0b45804e7256959819d3f11bb7935b588
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6f9e67e0b45804e7256959819d3f11bb7935b588

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sat Nov 12 14:32:31 2011 +0100

mshtml: Use set_nsstyle_attr_var in IHTMLStyle::put_height implementation.

---

 dlls/mshtml/htmlstyle.c   |   10 +---------
 dlls/mshtml/tests/style.c |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c
index a9c6133..f006193 100644
--- a/dlls/mshtml/htmlstyle.c
+++ b/dlls/mshtml/htmlstyle.c
@@ -2069,15 +2069,7 @@ static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)
 
     TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
 
-    switch(V_VT(&v)) {
-    case VT_BSTR:
-        return set_style_attr(This, STYLEID_HEIGHT, V_BSTR(&v), 0);
-    default:
-        FIXME("unimplemented vt %d\n", V_VT(&v));
-        return E_NOTIMPL;
-    }
-
-    return S_OK;
+    return set_nsstyle_attr_var(This->nsstyle, STYLEID_HEIGHT, &v, ATTR_FIX_PX);
 }
 
 static HRESULT WINAPI HTMLStyle_get_height(IHTMLStyle *iface, VARIANT *p)
diff --git a/dlls/mshtml/tests/style.c b/dlls/mshtml/tests/style.c
index e37c593..bdb3dc2 100644
--- a/dlls/mshtml/tests/style.c
+++ b/dlls/mshtml/tests/style.c
@@ -872,7 +872,7 @@ static void test_body_style(IHTMLStyle *style)
        "expected 4.0 or 4.9 (IE8) got %f\n", f);
 
     V_VT(&v) = VT_BSTR;
-    V_BSTR(&v) = a2bstr("64px");
+    V_BSTR(&v) = a2bstr("70px");
     hres = IHTMLStyle_put_height(style, v);
     ok(hres == S_OK, "put_height failed: %08x\n", hres);
     VariantClear(&v);
@@ -881,6 +881,18 @@ static void test_body_style(IHTMLStyle *style)
     hres = IHTMLStyle_get_height(style, &v);
     ok(hres == S_OK, "get_height failed: %08x\n", hres);
     ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
+    ok(!strcmp_wa(V_BSTR(&v), "70px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
+    VariantClear(&v);
+
+    V_VT(&v) = VT_I4;
+    V_I4(&v) = 64;
+    hres = IHTMLStyle_put_height(style, v);
+    ok(hres == S_OK, "put_height failed: %08x\n", hres);
+
+    V_VT(&v) = VT_EMPTY;
+    hres = IHTMLStyle_get_height(style, &v);
+    ok(hres == S_OK, "get_height failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
     ok(!strcmp_wa(V_BSTR(&v), "64px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
     VariantClear(&v);
 




More information about the wine-cvs mailing list