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

This commit is contained in:
Jacek Caban 2008-10-07 14:45:31 -05:00 committed by Alexandre Julliard
parent cbc186b865
commit 4d822f4408
3 changed files with 28 additions and 4 deletions

View File

@ -72,6 +72,8 @@ static const WCHAR attrPaddingLeft[] =
{'p','a','d','d','i','n','g','-','l','e','f','t',0};
static const WCHAR attrPosition[] =
{'p','o','s','i','t','i','o','n',0};
static const WCHAR attrTextAlign[] =
{'t','e','x','t','-','a','l','i','g','n',0};
static const WCHAR attrTextDecoration[] =
{'t','e','x','t','-','d','e','c','o','r','a','t','i','o','n',0};
static const WCHAR attrTop[] =
@ -108,6 +110,7 @@ static const struct{
{attrMarginRight, DISPID_IHTMLSTYLE_MARGINRIGHT},
{attrPaddingLeft, DISPID_IHTMLSTYLE_PADDINGLEFT},
{attrPosition, DISPID_IHTMLSTYLE2_POSITION},
{attrTextAlign, DISPID_IHTMLSTYLE_TEXTALIGN},
{attrTextDecoration, DISPID_IHTMLSTYLE_TEXTDECORATION},
{attrTop, DISPID_IHTMLSTYLE_TOP},
{attrVerticalAlign, DISPID_IHTMLSTYLE_VERTICALALIGN},
@ -847,15 +850,19 @@ static HRESULT WINAPI HTMLStyle_get_textTransform(IHTMLStyle *iface, BSTR *p)
static HRESULT WINAPI HTMLStyle_put_textAlign(IHTMLStyle *iface, BSTR v)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
return set_style_attr(This, STYLEID_TEXT_ALIGN, v, 0);
}
static HRESULT WINAPI HTMLStyle_get_textAlign(IHTMLStyle *iface, BSTR *p)
{
HTMLStyle *This = HTMLSTYLE_THIS(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, p);
return get_style_attr(This, STYLEID_TEXT_ALIGN, p);
}
static HRESULT WINAPI HTMLStyle_put_textIndent(IHTMLStyle *iface, VARIANT v)

View File

@ -50,6 +50,7 @@ typedef enum {
STYLEID_MARGIN_RIGHT,
STYLEID_PADDING_LEFT,
STYLEID_POSITION,
STYLEID_TEXT_ALIGN,
STYLEID_TEXT_DECORATION,
STYLEID_TOP,
STYLEID_VERTICAL_ALIGN,

View File

@ -2250,6 +2250,22 @@ static void test_default_style(IHTMLStyle *style)
ok(!strcmp_wa(V_BSTR(&v), "middle"), "V_BSTR(v) = %s\n", 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);
ok(!str, "textAlign != NULL\n");
str = a2bstr("center");
hres = IHTMLStyle_put_textAlign(style, str);
ok(hres == S_OK, "put_textAlign failed: %08x\n", hres);
SysFreeString(str);
str = NULL;
hres = IHTMLStyle_get_textAlign(style, &str);
ok(hres == S_OK, "get_textAlign failed: %08x\n", hres);
ok(!strcmp_wa(str, "center"), "textAlign = %s\n", dbgstr_w(V_BSTR(&v)));
SysFreeString(str);
V_VT(&v) = VT_EMPTY;
hres = IHTMLStyle_get_zIndex(style, &v);
ok(hres == S_OK, "get_zIndex failed: %08x\n", hres);