Zhenbo Li : mshtml: Added IHTMLTableCell::cellIndex method implementation.

Alexandre Julliard julliard at winehq.org
Mon Jun 16 12:37:50 CDT 2014


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

Author: Zhenbo Li <litimetal at gmail.com>
Date:   Fri Jun 13 07:29:21 2014 +0800

mshtml: Added IHTMLTableCell::cellIndex method implementation.

---

 dlls/mshtml/htmltablecell.c |   12 ++++++++++--
 dlls/mshtml/tests/dom.c     |   26 ++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/dlls/mshtml/htmltablecell.c b/dlls/mshtml/htmltablecell.c
index 7b8d2fc..e023e31 100644
--- a/dlls/mshtml/htmltablecell.c
+++ b/dlls/mshtml/htmltablecell.c
@@ -268,8 +268,16 @@ static HRESULT WINAPI HTMLTableCell_get_height(IHTMLTableCell *iface, VARIANT *p
 static HRESULT WINAPI HTMLTableCell_get_cellIndex(IHTMLTableCell *iface, LONG *p)
 {
     HTMLTableCell *This = impl_from_IHTMLTableCell(iface);
-    FIXME("(%p)->(%p)\n", This, p);
-    return E_NOTIMPL;
+    nsresult nsres;
+
+    TRACE("(%p)->(%p)\n", This, p);
+    nsres = nsIDOMHTMLTableCellElement_GetCellIndex(This->nscell, p);
+    if (NS_FAILED(nsres)) {
+        ERR("Get CellIndex failed: %08x\n", nsres);
+        return E_FAIL;
+    }
+
+    return S_OK;
 }
 
 static const IHTMLTableCellVtbl HTMLTableCellVtbl = {
diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c
index 4eb02fc..941e87b 100644
--- a/dlls/mshtml/tests/dom.c
+++ b/dlls/mshtml/tests/dom.c
@@ -5852,6 +5852,25 @@ static void test_tr_elem(IHTMLElement *elem)
     IHTMLTableRow_Release(row);
 }
 
+static void test_td_elem(IHTMLElement *elem)
+{
+    IHTMLTableCell *cell;
+    HRESULT hres;
+    LONG lval;
+
+    hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLTableCell, (void**)&cell);
+    ok(hres == S_OK, "Could not get IHTMLTableRow iface: %08x\n", hres);
+    if(FAILED(hres))
+        return;
+
+    lval = 0xdeadbeef;
+    hres = IHTMLTableCell_get_cellIndex(cell, &lval);
+    ok(hres == S_OK, "get cellIndex failed: %08x\n", hres);
+    ok(lval == 1, "Expected 1, got %d\n", lval);
+
+    IHTMLTableCell_Release(cell);
+}
+
 static void test_label_elem(IHTMLElement *elem)
 {
     IHTMLLabelElement *label;
@@ -6813,6 +6832,13 @@ static void test_elems(IHTMLDocument2 *doc)
         IHTMLElement_Release(elem);
     }
 
+    elem = get_doc_elem_by_id(doc, "td2");
+    ok(elem != NULL, "elem == NULL\n");
+    if(elem) {
+        test_td_elem(elem);
+        IHTMLElement_Release(elem);
+    }
+
     elem = get_doc_elem_by_id(doc, "row2");
     ok(elem != NULL, "elem == NULL\n");
     if(elem) {




More information about the wine-cvs mailing list