mshtml: Added IHTMLTableCell::align property implementation.

This commit is contained in:
Zhenbo Li 2014-08-18 16:56:57 +08:00 committed by Alexandre Julliard
parent 03b377f3e7
commit 06c66876f3
2 changed files with 37 additions and 4 deletions

View File

@ -128,15 +128,33 @@ static HRESULT WINAPI HTMLTableCell_get_colSpan(IHTMLTableCell *iface, LONG *p)
static HRESULT WINAPI HTMLTableCell_put_align(IHTMLTableCell *iface, BSTR v)
{
HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
nsAString str;
nsresult nsres;
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
nsAString_InitDepend(&str, v);
nsres = nsIDOMHTMLTableCellElement_SetAlign(This->nscell, &str);
nsAString_Finish(&str);
if (NS_FAILED(nsres)) {
ERR("Set Align failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLTableCell_get_align(IHTMLTableCell *iface, BSTR *p)
{
HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
nsAString str;
nsresult nsres;
TRACE("(%p)->(%p)\n", This, p);
nsAString_Init(&str, NULL);
nsres = nsIDOMHTMLTableCellElement_GetAlign(This->nscell, &str);
return return_nsstr(nsres, &str, p);
}
static HRESULT WINAPI HTMLTableCell_put_vAlign(IHTMLTableCell *iface, BSTR v)

View File

@ -5940,6 +5940,7 @@ static void test_td_elem(IHTMLElement *elem)
IHTMLTableCell *cell;
HRESULT hres;
LONG lval;
BSTR str;
hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTableCell, (void**)&cell);
ok(hres == S_OK, "Could not get IHTMLTableRow iface: %08x\n", hres);
@ -5951,6 +5952,20 @@ static void test_td_elem(IHTMLElement *elem)
ok(hres == S_OK, "get cellIndex failed: %08x\n", hres);
ok(lval == 1, "Expected 1, got %d\n", lval);
str = a2bstr("left");
hres = IHTMLTableCell_put_align(cell, str);
ok(hres == S_OK, "put_align failed: %08x\n", hres);
SysFreeString(str);
str = NULL;
hres = IHTMLTableCell_get_align(cell, &str);
ok(hres == S_OK, "get_align failed: %08x\n", hres);
ok(str != NULL, "str is NULL\n");
if (str != NULL && hres == S_OK) {
ok(!strcmp_wa(str, "left"), "got %s\n", wine_dbgstr_w(str));
SysFreeString(str);
}
IHTMLTableCell_Release(cell);
}