Commit 64adaf72 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Added QueryStatus implementation.

parent 7ac34f9e
......@@ -868,9 +868,26 @@ static HRESULT WINAPI WBOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{
WebBrowser *This = OLECMD_THIS(iface);
FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
IOleCommandTarget *cmdtrg;
HRESULT hres;
TRACE("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
pCmdText);
return E_NOTIMPL;
if(!This->doc_host.document)
return 0x80040104;
/* NOTE: There are probably some commands that we should handle here
* instead of forwarding to document object. */
hres = IUnknown_QueryInterface(This->doc_host.document, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(FAILED(hres))
return hres;
hres = IOleCommandTarget_QueryStatus(cmdtrg, pguidCmdGroup, cCmds, prgCmds, pCmdText);
IOleCommandTarget_Release(cmdtrg);
return hres;
}
static HRESULT WINAPI WBOleCommandTarget_Exec(IOleCommandTarget *iface,
......
......@@ -30,6 +30,7 @@
#include "exdisp.h"
#include "htiframe.h"
#include "mshtmhst.h"
#include "mshtmcid.h"
#include "idispids.h"
#include "olectl.h"
#include "mshtmdid.h"
......@@ -2123,6 +2124,36 @@ static void test_download(void)
CHECK_CALLED(Invoke_DOCUMENTCOMPLETE);
}
static void test_olecmd(IUnknown *unk, BOOL loaded)
{
IOleCommandTarget *cmdtrg;
OLECMD cmds[3];
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IOleCommandTarget, (void**)&cmdtrg);
ok(hres == S_OK, "Could not get IOleCommandTarget iface: %08x\n", hres);
if(FAILED(hres))
return;
cmds[0].cmdID = OLECMDID_SPELL;
cmds[0].cmdf = 0xdeadbeef;
cmds[1].cmdID = OLECMDID_REFRESH;
cmds[1].cmdf = 0xdeadbeef;
hres = IOleCommandTarget_QueryStatus(cmdtrg, NULL, 2, cmds, NULL);
if(loaded) {
ok(hres == S_OK, "QueryStatus failed: %08x\n", hres);
ok(cmds[0].cmdf == OLECMDF_SUPPORTED, "OLECMDID_SPELL cmdf = %x\n", cmds[0].cmdf);
ok(cmds[1].cmdf == (OLECMDF_ENABLED|OLECMDF_SUPPORTED),
"OLECMDID_REFRESH cmdf = %x\n", cmds[1].cmdf);
}else {
ok(hres == 0x80040104, "QueryStatus failed: %08x\n", hres);
ok(cmds[0].cmdf == 0xdeadbeef, "OLECMDID_SPELL cmdf = %x\n", cmds[0].cmdf);
ok(cmds[1].cmdf == 0xdeadbeef, "OLECMDID_REFRESH cmdf = %x\n", cmds[0].cmdf);
}
IOleCommandTarget_Release(cmdtrg);
}
static void test_IServiceProvider(IUnknown *unk)
{
IServiceProvider *servprov = (void*)0xdeadbeef;
......@@ -2213,10 +2244,12 @@ static void test_WebBrowser(BOOL do_download)
test_Extent(unk);
test_wb_funcs(unk, TRUE);
test_DoVerb(unk);
test_olecmd(unk, FALSE);
test_Navigate2(unk);
if(do_download) {
test_download();
test_olecmd(unk, TRUE);
}
test_ClientSite(unk, NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment