Commit 3d2d9596 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use helpers for IHTMLStyle::put_verticalAlign property implementation.

parent e87cb774
......@@ -1350,32 +1350,16 @@ static HRESULT WINAPI HTMLStyle_put_verticalAlign(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_VERTICAL_ALIGN, V_BSTR(&v), 0);
default:
FIXME("not implemented vt %d\n", V_VT(&v));
return E_NOTIMPL;
}
return S_OK;
return set_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, &v, ATTR_FIX_PX);
}
static HRESULT WINAPI HTMLStyle_get_verticalAlign(IHTMLStyle *iface, VARIANT *p)
{
HTMLStyle *This = impl_from_IHTMLStyle(iface);
BSTR ret;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, p);
hres = get_style_attr(This, STYLEID_VERTICAL_ALIGN, &ret);
if(FAILED(hres))
return hres;
V_VT(p) = VT_BSTR;
V_BSTR(p) = ret;
return S_OK;
return get_nsstyle_attr_var(This->nsstyle, STYLEID_VERTICAL_ALIGN, p, 0);
}
static HRESULT WINAPI HTMLStyle_put_textTransform(IHTMLStyle *iface, BSTR v)
......
......@@ -1022,6 +1022,19 @@ static void test_body_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "middle"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
V_VT(&v) = VT_I4;
V_I4(&v) = 100;
hres = IHTMLStyle_put_verticalAlign(style, v);
ok(hres == S_OK, "put_vertivalAlign failed: %08x\n", hres);
VariantClear(&v);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_verticalAlign(style, &v);
ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "100px"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
str = (void*)0xdeadbeef;
hres = IHTMLStyle_get_textAlign(style, &str);
ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
......@@ -2099,7 +2112,7 @@ static void test_current_style(IHTMLCurrentStyle *current_style)
hres = IHTMLCurrentStyle_get_verticalAlign(current_style, &v);
ok(hres == S_OK, "get_verticalAlign failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "middle"), "get_verticalAlign returned %s\n", wine_dbgstr_w(V_BSTR(&v)));
ok(!strcmp_wa(V_BSTR(&v), "100px"), "get_verticalAlign returned %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
hres = IHTMLCurrentStyle_get_marginRight(current_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