mshtml: Added IHTMLTableRow::insertCell method implementation.
This commit is contained in:
parent
4719c438a9
commit
48e41c4dd7
|
@ -308,8 +308,27 @@ static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementC
|
|||
static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, LONG index, IDispatch **row)
|
||||
{
|
||||
HTMLTableRow *This = impl_from_IHTMLTableRow(iface);
|
||||
FIXME("(%p)->(%d %p)\n", This, index, row);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLElement *nselem;
|
||||
HTMLElement *elem;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%d %p)\n", This, index, row);
|
||||
nsres = nsIDOMHTMLTableRowElement_InsertCell(This->nsrow, index, &nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Insert Cell at %d failed: %08x\n", index, nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hres = HTMLTableCell_Create(This->element.node.doc, nselem, &elem);
|
||||
nsIDOMHTMLElement_Release(nselem);
|
||||
if (FAILED(hres)) {
|
||||
ERR("Create TableCell failed: %08x\n", hres);
|
||||
return hres;
|
||||
}
|
||||
|
||||
*row = (IDispatch *)&elem->IHTMLElement_iface;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, LONG index)
|
||||
|
|
|
@ -5737,10 +5737,22 @@ static void _test_tr_possess(unsigned line, IHTMLElement *elem,
|
|||
static void test_tr_modify(IHTMLElement *elem, IHTMLTableRow *row)
|
||||
{
|
||||
HRESULT hres;
|
||||
IDispatch *disp;
|
||||
IUnknown *unk;
|
||||
|
||||
hres = IHTMLTableRow_deleteCell(row, 0);
|
||||
ok(hres == S_OK, "deleteCell failed: %08x\n", hres);
|
||||
test_tr_possess(elem, row, 1, "td2");
|
||||
|
||||
hres = IHTMLTableRow_insertCell(row, 0, &disp);
|
||||
ok(hres == S_OK, "insertCell failed: %08x\n", hres);
|
||||
ok(disp != NULL, "disp == NULL\n");
|
||||
hres = IDispatch_QueryInterface(disp, &IID_IHTMLTableCell, (void **)&unk);
|
||||
ok(hres == S_OK, "Could not get IID_IHTMLTableCell interface: %08x\n", hres);
|
||||
if (SUCCEEDED(hres))
|
||||
IUnknown_Release(unk);
|
||||
test_tr_possess(elem, row, 2, "td2");
|
||||
IDispatch_Release(disp);
|
||||
}
|
||||
|
||||
static void test_tr_elem(IHTMLElement *elem)
|
||||
|
|
Loading…
Reference in New Issue