Zhenbo Li : mshtml: Added IHTMLTable::summary property implementation.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jul 15 15:52:43 CDT 2014


Module: wine
Branch: master
Commit: 720207ad4630b8cfb591c68bd3a27bba9ed9cfbc
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=720207ad4630b8cfb591c68bd3a27bba9ed9cfbc

Author: Zhenbo Li <litimetal at gmail.com>
Date:   Tue Jul 15 21:06:41 2014 +0800

mshtml: Added IHTMLTable::summary property implementation.

---

 dlls/mshtml/htmltable.c | 28 ++++++++++++++++++++++++----
 dlls/mshtml/tests/dom.c | 17 +++++++++++++++++
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/dlls/mshtml/htmltable.c b/dlls/mshtml/htmltable.c
index 0f64330..e7991da 100644
--- a/dlls/mshtml/htmltable.c
+++ b/dlls/mshtml/htmltable.c
@@ -869,15 +869,35 @@ static HRESULT WINAPI HTMLTable3_Invoke(IHTMLTable3 *iface, DISPID dispIdMember,
 static HRESULT WINAPI HTMLTable3_put_summary(IHTMLTable3 *iface, BSTR v)
 {
     HTMLTable *This = impl_from_IHTMLTable3(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 = nsIDOMHTMLTableElement_SetSummary(This->nstable, &str);
+
+    nsAString_Finish(&str);
+    if (NS_FAILED(nsres)) {
+        ERR("Set summary(%s) failed: %08x\n", debugstr_w(v), nsres);
+        return E_FAIL;
+    }
+    return S_OK;
 }
 
 static HRESULT WINAPI HTMLTable3_get_summary(IHTMLTable3 *iface, BSTR * p)
 {
     HTMLTable *This = impl_from_IHTMLTable3(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 = nsIDOMHTMLTableElement_GetSummary(This->nstable, &str);
+
+    return return_nsstr(nsres, &str, p);
 }
 
 static const IHTMLTable3Vtbl HTMLTable3Vtbl = {
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 941e87b..532bbfb 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5930,6 +5930,7 @@ static void test_table_elem(IHTMLElement *elem)
 {
     IHTMLElementCollection *col;
     IHTMLTable *table;
+    IHTMLTable3 *table3;
     IHTMLDOMNode *node;
     VARIANT v;
     HRESULT hres;
@@ -5945,6 +5946,11 @@ static void test_table_elem(IHTMLElement *elem)
     if(FAILED(hres))
         return;
 
+    hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTable3, (void**)&table3);
+    ok(hres == S_OK, "Could not get IHTMLTable3 iface: %08x\n", hres);
+    if(FAILED(hres))
+        return;
+
     col = NULL;
     hres = IHTMLTable_get_rows(table, &col);
     ok(hres == S_OK, "get_rows failed: %08x\n", hres);
@@ -6082,6 +6088,17 @@ static void test_table_elem(IHTMLElement *elem)
     ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v)));
     VariantClear(&v);
 
+    bstr = a2bstr("summary");
+    hres = IHTMLTable3_put_summary(table3, bstr);
+    ok(hres == S_OK, "put_summary = %08x\n", hres);
+    SysFreeString(bstr);
+
+    hres = IHTMLTable3_get_summary(table3, &bstr);
+    ok(hres == S_OK, "get_summary = %08x\n", hres);
+    ok(!strcmp_wa(bstr, "summary"), "Expected summary, got %s\n", wine_dbgstr_w(bstr));
+    SysFreeString(bstr);
+
+    IHTMLTable3_Release(table3);
     IHTMLTable_Release(table);
 }
 




More information about the wine-cvs mailing list