mshtml: Added IHTMLStyle::[get|put]_width implementation.

This commit is contained in:
Jacek Caban 2008-06-30 21:39:52 +02:00 committed by Alexandre Julliard
parent 4690d6d572
commit 45eba140e6
2 changed files with 37 additions and 3 deletions

View File

@ -73,6 +73,8 @@ static const WCHAR attrTextDecoration[] =
{'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
static const WCHAR attrVisibility[] =
{'v','i','s','i','b','i','l','i','t','y',0};
static const WCHAR attrWidth[] =
{'w','i','d','t','h',0};
static const WCHAR valLineThrough[] =
{'l','i','n','e','-','t','h','r','o','u','g','h',0};
@ -1237,15 +1239,28 @@ static HRESULT WINAPI HTMLStyle_get_borderLeftStyle(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_width(IHTMLStyle *iface, VARIANT v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(v%d)\n", This, V_VT(&v));
TRACE("(%p)->(v%d)\n", This, V_VT(&v));
switch(V_VT(&v)) {
case VT_BSTR:
TRACE("%s\n", debugstr_w(V_BSTR(&v)));
return set_style_attr(This, attrWidth, V_BSTR(&v), 0);
default:
FIXME("unsupported vt %d\n", V_VT(&v));
}
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLStyle_get_width(IHTMLStyle *iface, VARIANT *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
V_VT(p) = VT_BSTR;
return get_style_attr(This, attrWidth, &V_BSTR(p));
}
static HRESULT WINAPI HTMLStyle_put_height(IHTMLStyle *iface, VARIANT v)

View File

@ -1817,6 +1817,25 @@ static void test_default_style(IHTMLStyle *style)
hres = IHTMLStyle_get_textDecorationLineThrough(style, &b);
ok(hres == S_OK, "get_textDecorationLineThrough failed: %08x\n", hres);
ok(b == VARIANT_FALSE, "textDecorationLineThrough = %x\n", b);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_width(style, &v);
ok(hres == S_OK, "get_width failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
ok(!V_BSTR(&v), "V_BSTR(v)=%p\n", V_BSTR(&v));
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = a2bstr("auto");
hres = IHTMLStyle_put_width(style, v);
ok(hres == S_OK, "put_width failed: %08x\n", hres);
VariantClear(&v);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_width(style, &v);
ok(hres == S_OK, "get_width failed: %08x\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v)=%d\n", V_VT(&v));
ok(!strcmp_wa(V_BSTR(&v), "auto"), "V_BSTR(v)=%s\n", dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
}
static void test_default_selection(IHTMLDocument2 *doc)