Commit d22928fb authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

ieframe: Send command state change notifications from history navigation handlers.

parent 9db50228
......@@ -273,6 +273,7 @@ HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
void on_commandstate_change(DocHost*,LONG,VARIANT_BOOL) DECLSPEC_HIDDEN;
#define WM_DOCHOSTTASK (WM_USER+0x300)
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
......
......@@ -773,6 +773,27 @@ static void doc_navigate_task_destr(task_header_t *t)
heap_free(task);
}
void on_commandstate_change(DocHost *doc_host, LONG command, VARIANT_BOOL enable)
{
DISPPARAMS dispparams;
VARIANTARG params[2];
TRACE("command=%d enable=%d\n", command, enable);
dispparams.cArgs = 2;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = params;
V_VT(params) = VT_BOOL;
V_BOOL(params) = enable;
V_VT(params+1) = VT_I4;
V_I4(params+1) = command;
call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
}
static void doc_navigate_proc(DocHost *This, task_header_t *t)
{
task_doc_navigate_t *task = (task_doc_navigate_t*)t;
......@@ -876,6 +897,9 @@ static HRESULT navigate_bsc(DocHost *This, BindStatusCallback *bsc, IMoniker *mo
return S_OK;
}
on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_FALSE);
on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
if(This->document)
deactivate_document(This);
......@@ -1069,6 +1093,17 @@ static HRESULT navigate_history(DocHost *This, unsigned travellog_pos)
return E_NOTIMPL;
}
if (travellog_pos < This->travellog.position)
{
on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_FALSE);
on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_TRUE);
}
else if (travellog_pos > This->travellog.position)
{
on_commandstate_change(This, CSC_NAVIGATEBACK, VARIANT_TRUE);
on_commandstate_change(This, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
}
This->travellog.loading_pos = travellog_pos;
entry = This->travellog.log + This->travellog.loading_pos;
......
......@@ -442,6 +442,9 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
release_client_site(This);
if(!pClientSite) {
on_commandstate_change(&This->doc_host, CSC_NAVIGATEBACK, VARIANT_FALSE);
on_commandstate_change(&This->doc_host, CSC_NAVIGATEFORWARD, VARIANT_FALSE);
if(This->doc_host.document)
deactivate_document(&This->doc_host);
return S_OK;
......
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