Zhenbo Li : mshtml: Added IHTMLTableCell::align property implementation.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 18 16:08:49 CDT 2014
Module: wine
Branch: master
Commit: 06c66876f3457bee8490396d1c19d46811f236fd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=06c66876f3457bee8490396d1c19d46811f236fd
Author: Zhenbo Li <litimetal at gmail.com>
Date: Mon Aug 18 16:56:57 2014 +0800
mshtml: Added IHTMLTableCell::align property implementation.
---
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 859cdac..cfde7ac 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -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);
}
More information about the wine-cvs
mailing list