Commit f89ac6fa authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Added DocHost::Exec(OLECMDID_UPDATECOMMANDS) implementation.

parent bad21ebe
......@@ -447,8 +447,14 @@ static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface,
nCmdexecopt, debugstr_variant(pvaIn), debugstr_variant(pvaOut));
if(!pguidCmdGroup) {
FIXME("Unimplemented cmdid %d\n", nCmdID);
return E_NOTIMPL;
switch(nCmdID) {
case OLECMDID_UPDATECOMMANDS:
return This->container_vtbl->exec(This, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
default:
FIXME("Unimplemented cmdid %d\n", nCmdID);
return E_NOTIMPL;
}
return S_OK;
}
if(IsEqualGUID(pguidCmdGroup, &CGID_DocHostCmdPriv)) {
......
......@@ -739,10 +739,16 @@ static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
}
static HRESULT DocHostContainer_exec(DocHost* This, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
VARIANT *out)
{
return S_OK;
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
DocHostContainer_GetDocObjRect,
DocHostContainer_SetStatusText,
DocHostContainer_SetURL
DocHostContainer_SetURL,
DocHostContainer_exec
};
HRESULT InternetExplorer_Create(IUnknown *pOuter, REFIID riid, void **ppv)
......
......@@ -89,6 +89,7 @@ typedef struct _IDocHostContainerVtbl
void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
void (WINAPI* SetURL)(DocHost*,LPCWSTR);
HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
} IDocHostContainerVtbl;
struct DocHost {
......
......@@ -1135,6 +1135,8 @@ static const IServiceProviderVtbl ServiceProviderVtbl =
WebBrowser_IServiceProvider_QueryService
};
#define DOCHOST_THIS(iface) DEFINE_THIS2(WebBrowser,doc_host,iface)
static void WINAPI DocHostContainer_GetDocObjRect(DocHost* This, RECT* rc)
{
GetClientRect(This->frame_hwnd, rc);
......@@ -1150,10 +1152,43 @@ static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
}
static HRESULT DocHostContainer_exec(DocHost *doc_host, const GUID *cmd_group, DWORD cmdid, DWORD execopt, VARIANT *in,
VARIANT *out)
{
WebBrowser *This = DOCHOST_THIS(doc_host);
IOleCommandTarget *cmdtrg = NULL;
HRESULT hres;
if(This->client) {
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(FAILED(hres))
cmdtrg = NULL;
}
if(!cmdtrg && This->container) {
hres = IOleContainer_QueryInterface(This->container, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(FAILED(hres))
cmdtrg = NULL;
}
if(!cmdtrg)
return S_OK;
hres = IOleCommandTarget_Exec(cmdtrg, cmd_group, cmdid, execopt, in, out);
IOleCommandTarget_Release(cmdtrg);
if(FAILED(hres))
FIXME("Exec failed\n");
return hres;
}
#undef DOCHOST_THIS
static const IDocHostContainerVtbl DocHostContainerVtbl = {
DocHostContainer_GetDocObjRect,
DocHostContainer_SetStatusText,
DocHostContainer_SetURL
DocHostContainer_SetURL,
DocHostContainer_exec
};
static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv)
......
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