mshtml: Added IHTMLDocument2::clear implementation.

This commit is contained in:
Jacek Caban 2010-05-07 15:20:10 +02:00 committed by Alexandre Julliard
parent 95ded555e0
commit 3d0d27820f
2 changed files with 29 additions and 2 deletions

View File

@ -889,8 +889,25 @@ static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
{
HTMLDocument *This = HTMLDOC_THIS(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
nsIDOMNSHTMLDocument *nsdoc;
nsresult nsres;
TRACE("(%p)\n", This);
nsres = nsIDOMHTMLDocument_QueryInterface(This->doc_node->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nsdoc);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNSHTMLDocument iface: %08x\n", nsres);
return E_FAIL;
}
nsres = nsIDOMNSHTMLDocument_Clear(nsdoc);
nsIDOMNSHTMLDocument_Release(nsdoc);
if(NS_FAILED(nsres)) {
ERR("Clear failed: %08x\n", nsres);
return E_FAIL;
}
return S_OK;
}
static HRESULT WINAPI HTMLDocument_queryCommandSupported(IHTMLDocument2 *iface, BSTR cmdID,

View File

@ -3405,6 +3405,14 @@ static void test_put_href(IHTMLDocument2 *doc)
test_download(DWL_VERBDONE);
}
static void test_clear(IHTMLDocument2 *doc)
{
HRESULT hres;
hres = IHTMLDocument2_clear(doc);
ok(hres == S_OK, "clear failed: %08x\n", hres);
}
static const OLECMDF expect_cmds[OLECMDID_GETPRINTTEMPLATE+1] = {
0,
OLECMDF_SUPPORTED, /* OLECMDID_OPEN */
@ -4566,6 +4574,8 @@ static void test_HTMLDocument_hlink(void)
test_Close(doc, FALSE);
test_IsDirty(doc, S_FALSE);
test_GetCurMoniker((IUnknown*)doc, &Moniker, NULL);
test_clear(doc);
test_GetCurMoniker((IUnknown*)doc, &Moniker, NULL);
if(view)
IOleDocumentView_Release(view);