Added exec_on_unload implementation.

This commit is contained in:
Jacek Caban 2005-09-02 11:16:39 +00:00 committed by Alexandre Julliard
parent 484e8e28b9
commit 3cbbd41246
2 changed files with 44 additions and 7 deletions

View File

@ -634,8 +634,16 @@ static HRESULT exec_enable_interaction(HTMLDocument *This, DWORD nCmdexecopt, VA
static HRESULT exec_on_unload(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) static HRESULT exec_on_unload(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{ {
FIXME("(%p)->(%ld %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut); TRACE("(%p)->(%ld %p %p)\n", This, nCmdexecopt, pvaIn, pvaOut);
return E_NOTIMPL;
/* Tests show that we have nothing more to do here */
if(pvaOut) {
V_VT(pvaOut) = VT_BOOL;
V_BOOL(pvaOut) = VARIANT_TRUE;
}
return S_OK;
} }
static HRESULT exec_show_page_setup(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut) static HRESULT exec_show_page_setup(HTMLDocument *This, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
@ -775,7 +783,7 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con
} }
} }
if(pguidCmdGroup) if(pCmdText)
FIXME("Set pCmdText\n"); FIXME("Set pCmdText\n");
}else { }else {
FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup)); FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));
@ -797,9 +805,13 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
} }
return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut); return exec_table[nCmdID].func(This, nCmdexecopt, pvaIn, pvaOut);
}else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) {
FIXME("unsupported nCmdID %ld of CGID_Explorer group\n", nCmdID);
TRACE("%p %p\n", pvaIn, pvaOut);
return OLECMDERR_E_NOTSUPPORTED;
}else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) {
FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID); FIXME("unsupported nCmdID %ld of CGID_ShellDocView group\n", nCmdID);
return OLECMDERR_E_UNKNOWNGROUP; return OLECMDERR_E_NOTSUPPORTED;
} }
FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup)); FIXME("Unsupported pguidCmdGroup %s\n", debugstr_guid(pguidCmdGroup));

View File

@ -210,8 +210,7 @@ static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
static const WCHAR wszHTML_Document[] = static const WCHAR wszHTML_Document[] =
{'H','T','M','L',' ','D','o','c','u','m','e','n','t',0}; {'H','T','M','L',' ','D','o','c','u','m','e','n','t',0};
ok(expect_SetActiveObject, "unexpected call\n"); CHECK_EXPECT2(SetActiveObject);
called_SetActiveObject = TRUE;
if(expect_SetActiveObject_active) { if(expect_SetActiveObject_active) {
ok(pActiveObject != NULL, "pActiveObject = NULL\n"); ok(pActiveObject != NULL, "pActiveObject = NULL\n");
@ -1077,6 +1076,7 @@ static HRESULT QueryInterface(REFIID riid, void **ppv)
/* TODO: /* TODO:
* IServiceProvider * IServiceProvider
* IOleInPlaceSiteEx
* {D48A6EC6-6A4A-11CF-94A7-444553540000} * {D48A6EC6-6A4A-11CF-94A7-444553540000}
* {7BB0B520-B1A7-11D2-BB23-00C04F79ABCD} * {7BB0B520-B1A7-11D2-BB23-00C04F79ABCD}
* {000670BA-0000-0000-C000-000000000046} * {000670BA-0000-0000-C000-000000000046}
@ -1365,6 +1365,31 @@ static void test_OleCommandTarget_fail(IUnknown *unk)
IOleCommandTarget_Release(cmdtrg); IOleCommandTarget_Release(cmdtrg);
} }
static void test_exec_onunload(IUnknown *unk)
{
IOleCommandTarget *cmdtrg;
VARIANT var;
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IOleCommandTarget, (void**)&cmdtrg);
ok(hres == S_OK, "QueryInterface(IID_IOleCommandTarget) failed: %08lx\n", hres);
if(FAILED(hres))
return;
memset(&var, 0x0a, sizeof(var));
hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_ONUNLOAD,
OLECMDEXECOPT_DODEFAULT, NULL, &var);
ok(hres == S_OK, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08lx\n", hres);
ok(V_VT(&var) == VT_BOOL, "V_VT(var)=%d, expected VT_BOOL\n", V_VT(&var));
ok(V_BOOL(&var) == VARIANT_TRUE, "V_BOOL(var)=%x, expected VARIANT_TRUE\n", V_BOOL(&var));
hres = IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_ONUNLOAD,
OLECMDEXECOPT_DODEFAULT, NULL, NULL);
ok(hres == S_OK, "Exec(..., OLECMDID_ONUNLOAD, ...) failed: %08lx\n", hres);
IOleCommandTarget_Release(cmdtrg);
}
static HWND create_container_window(void) static HWND create_container_window(void)
{ {
static const WCHAR wszHTMLDocumentTest[] = static const WCHAR wszHTMLDocumentTest[] =
@ -1825,6 +1850,7 @@ static void test_HTMLDocument_hlink(void)
test_download(); test_download();
#endif #endif
test_exec_onunload(unk);
test_Window(unk, TRUE); test_Window(unk, TRUE);
test_InPlaceDeactivate(unk, TRUE); test_InPlaceDeactivate(unk, TRUE);
test_Close(unk, FALSE); test_Close(unk, FALSE);
@ -1835,7 +1861,6 @@ static void test_HTMLDocument_hlink(void)
ref = IUnknown_Release(unk); ref = IUnknown_Release(unk);
ok(ref == 0, "ref=%ld, expected 0\n", ref); ok(ref == 0, "ref=%ld, expected 0\n", ref);
} }
START_TEST(htmldoc) START_TEST(htmldoc)