Module: wine Branch: master Commit: 3d0d27820f3a933763c581901b4e82cc9fc1a333 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3d0d27820f3a933763c581901b...
Author: Jacek Caban jacek@codeweavers.com Date: Fri May 7 15:20:10 2010 +0200
mshtml: Added IHTMLDocument2::clear implementation.
---
dlls/mshtml/htmldoc.c | 21 +++++++++++++++++++-- dlls/mshtml/tests/htmldoc.c | 10 ++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 12aa8c0..6147632 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -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, diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index c4c41a8..7e0d437 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -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);