ieframe: Return document as IHTMLDocument2 iface from get_document.

This commit is contained in:
Jacek Caban 2013-04-15 17:41:32 +02:00 committed by Alexandre Julliard
parent e8efc1e630
commit b93e61acf1
1 changed files with 15 additions and 20 deletions

View File

@ -277,7 +277,7 @@ static void _test_ready_state(unsigned line, READYSTATE exstate)
}
#define get_document(u) _get_document(__LINE__,u)
static IDispatch *_get_document(unsigned line, IWebBrowser2 *wb)
static IHTMLDocument2 *_get_document(unsigned line, IWebBrowser2 *wb)
{
IHTMLDocument2 *html_doc;
IDispatch *disp;
@ -291,22 +291,22 @@ static IDispatch *_get_document(unsigned line, IWebBrowser2 *wb)
hres = IDispatch_QueryInterface(disp, &IID_IHTMLDocument2, (void**)&html_doc);
ok_(__FILE__,line)(hres == S_OK, "Could not get IHTMLDocument iface: %08x\n", hres);
ok(disp == (IDispatch*)html_doc, "disp != html_doc\n");
IHTMLDocument2_Release(html_doc);
IDispatch_Release(disp);
return disp;
return html_doc;
}
#define get_dochost(u) _get_dochost(__LINE__,u)
static IOleClientSite *_get_dochost(unsigned line, IWebBrowser2 *unk)
{
IOleClientSite *client_site;
IHTMLDocument2 *doc;
IOleObject *oleobj;
IDispatch *doc;
HRESULT hres;
doc = _get_document(line, unk);
hres = IDispatch_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj);
IDispatch_Release(doc);
hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj);
IHTMLDocument2_Release(doc);
ok_(__FILE__,line)(hres == S_OK, "Got 0x%08x\n", hres);
hres = IOleObject_GetClientSite(oleobj, &client_site);
@ -2895,15 +2895,10 @@ static void test_put_href(IWebBrowser2 *unk, const char *url)
{
IHTMLLocation *location;
IHTMLDocument2 *doc;
IDispatch *doc_disp;
BSTR str;
HRESULT hres;
doc_disp = get_document(unk);
hres = IDispatch_QueryInterface(doc_disp, &IID_IHTMLDocument2, (void**)&doc);
IDispatch_Release(doc_disp);
ok(hres == S_OK, "QueryInterface(IID_IHTMLDocument2 failed: %08x\n", hres);
doc = get_document(unk);
location = NULL;
hres = IHTMLDocument2_get_location(doc, &location);
@ -3019,12 +3014,12 @@ static void test_QueryInterface(IWebBrowser2 *wb)
static void test_UIActivate(IWebBrowser2 *unk, BOOL activate)
{
IOleDocumentView *docview;
IDispatch *disp;
IHTMLDocument2 *doc;
HRESULT hres;
disp = get_document(unk);
doc = get_document(unk);
hres = IDispatch_QueryInterface(disp, &IID_IOleDocumentView, (void**)&docview);
hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleDocumentView, (void**)&docview);
ok(hres == S_OK, "Got 0x%08x\n", hres);
if(SUCCEEDED(hres)) {
if(activate) {
@ -3052,7 +3047,7 @@ static void test_UIActivate(IWebBrowser2 *unk, BOOL activate)
IOleDocumentView_Release(docview);
}
IDispatch_Release(disp);
IHTMLDocument2_Release(doc);
}
static void test_external(IWebBrowser2 *unk)
@ -3361,7 +3356,7 @@ static void test_WebBrowser(BOOL do_download, BOOL do_close)
test_ExecWB(webbrowser, TRUE, TRUE);
if(do_download) {
IDispatch *doc, *doc2;
IHTMLDocument2 *doc, *doc2;
test_download(0);
test_olecmd(webbrowser, TRUE);
@ -3371,15 +3366,15 @@ static void test_WebBrowser(BOOL do_download, BOOL do_close)
test_download(DWL_FROM_PUT_HREF);
doc2 = get_document(webbrowser);
ok(doc == doc2, "doc != doc2\n");
IDispatch_Release(doc2);
IHTMLDocument2_Release(doc2);
trace("Navigate2 repeated...\n");
test_Navigate2(webbrowser, "about:blank");
test_download(DWL_EXPECT_BEFORE_NAVIGATE);
doc2 = get_document(webbrowser);
ok(doc == doc2, "doc != doc2\n");
IDispatch_Release(doc2);
IDispatch_Release(doc);
IHTMLDocument2_Release(doc2);
IHTMLDocument2_Release(doc);
if(!do_close) {
trace("Navigate2 http URL...\n");