From: Zhenbo Li Subject: mshtml: Added IHTMLTableCell::align property implementation.(try 2) Message-Id: <53EE1E20.7050508@gmail.com> Date: Fri, 15 Aug 2014 22:50:08 +0800 Fix test error for patch 106030. Sorry for that. --- dlls/mshtml/htmltablecell.c | 26 ++++++++++++++++++++++---- dlls/mshtml/tests/dom.c | 15 +++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmltablecell.c b/dlls/mshtml/htmltablecell.c index e023e31..eedae5b 100644 --- a/dlls/mshtml/htmltablecell.c +++ b/dlls/mshtml/htmltablecell.c @@ -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) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 33645c8..989827c 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -5920,6 +5920,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); @@ -5931,6 +5932,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); }