Commit 221bb426 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ieframe: Store container IOleCommandTarget in DocHost.

parent 92468f78
......@@ -582,6 +582,11 @@ void release_dochost_client(DocHost *This)
IOleInPlaceFrame_Release(This->frame);
This->frame = NULL;
}
if(This->olecmd) {
IOleCommandTarget_Release(This->olecmd);
This->olecmd = NULL;
}
}
static inline DocHost *impl_from_IOleCommandTarget(IOleCommandTarget *iface)
......
......@@ -128,6 +128,7 @@ struct DocHost {
IDispatch *client_disp;
IDocHostUIHandler *hostui;
IOleInPlaceFrame *frame;
IOleCommandTarget *olecmd;
IUnknown *document;
IOleDocumentView *view;
......
......@@ -458,6 +458,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
{
WebBrowser *This = impl_from_IOleObject(iface);
IDocHostUIHandler *hostui;
IOleCommandTarget *olecmd;
IOleContainer *container;
IDispatch *disp;
HRESULT hres;
......@@ -502,9 +503,19 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
ITargetContainer_Release(target_container);
}
hres = IOleContainer_QueryInterface(container, &IID_IOleCommandTarget, (void**)&olecmd);
if(FAILED(hres))
olecmd = NULL;
IOleContainer_Release(container);
}else {
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(FAILED(hres))
olecmd = NULL;
}
This->doc_host.olecmd = olecmd;
create_shell_embedding_hwnd(This);
on_offlineconnected_change(This);
......
......@@ -1206,33 +1206,17 @@ static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text
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 = impl_from_DocHost(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)
if(!doc_host->olecmd)
return E_NOTIMPL;
hres = IOleCommandTarget_Exec(cmdtrg, cmd_group, cmdid, execopt, in, out);
IOleCommandTarget_Release(cmdtrg);
hres = IOleCommandTarget_Exec(doc_host->olecmd, cmd_group, cmdid, execopt, in, out);
if(SUCCEEDED(hres))
TRACE("Exec returned %08x %s\n", hres, debugstr_variant(out));
else
......
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