Commit 2cf2d8fe authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Call Exec(DOCHOST_DOCCANNAVIGATE) from IOleObject::SetClientSite.

parent 80f8a0df
......@@ -398,7 +398,7 @@ struct HTMLDocumentObj {
BOOL in_place_active;
BOOL ui_active;
BOOL window_active;
BOOL has_key_path;
BOOL hostui_setup;
BOOL container_locked;
BOOL focus;
INT download_state;
......
......@@ -34,9 +34,13 @@
#include "wine/debug.h"
#include "mshtml_private.h"
#include "initguid.h"
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
#define DOCHOST_DOCCANNAVIGATE 0
/**********************************************************
* IOleObject implementation
*/
......@@ -92,6 +96,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
HTMLDocument *This = OLEOBJ_THIS(iface);
IDocHostUIHandler *pDocHostUIHandler = NULL;
IOleCommandTarget *cmdtrg = NULL;
BOOL hostui_setup;
VARIANT silent;
HRESULT hres;
......@@ -116,6 +121,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
if(!pClientSite)
return S_OK;
hostui_setup = This->doc_obj->hostui_setup;
hres = IOleObject_QueryInterface(pClientSite, &IID_IDocHostUIHandler, (void**)&pDocHostUIHandler);
if(SUCCEEDED(hres)) {
DOCHOSTUIINFO hostinfo;
......@@ -133,7 +140,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->doc_obj->hostinfo = hostinfo;
}
if(!This->doc_obj->has_key_path) {
if(!hostui_setup) {
hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
if(hres == S_OK && key_path) {
if(key_path[0]) {
......@@ -157,7 +164,7 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
IDocHostUIHandler2_Release(pDocHostUIHandler2);
}
This->doc_obj->has_key_path = TRUE;
This->doc_obj->hostui_setup = TRUE;
}
}
......@@ -179,6 +186,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
VARIANT var;
OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
if(!hostui_setup) {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)HTMLWINDOW2(This->window);
IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
}
IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);
V_VT(&var) = VT_I4;
......
......@@ -3142,7 +3142,7 @@ static void test_Load(IPersistMoniker *persist, IMoniker *mon)
CHECK_CALLED(GetOptionKeyPath);
CHECK_CALLED(GetOverrideKeyPath);
CHECK_CALLED(GetWindow);
todo_wine CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(QueryStatus_SETPROGRESSTEXT);
CHECK_CALLED(Exec_SETPROGRESSMAX);
CHECK_CALLED(Exec_SETPROGRESSPOS);
......@@ -3865,7 +3865,7 @@ static void test_ClientSite(IOleObject *oleobj, DWORD flags)
}
CHECK_CALLED(GetWindow);
if(flags & CLIENTSITE_EXPECTPATH)
todo_wine CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(QueryStatus_SETPROGRESSTEXT);
CHECK_CALLED(Exec_SETPROGRESSMAX);
CHECK_CALLED(Exec_SETPROGRESSPOS);
......@@ -4987,7 +4987,7 @@ static void test_UIActivate(BOOL do_load, BOOL use_ipsex, BOOL use_ipsw)
CHECK_CALLED(GetOptionKeyPath);
CHECK_CALLED(GetOverrideKeyPath);
CHECK_CALLED(GetWindow);
todo_wine CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(Exec_DOCCANNAVIGATE);
CHECK_CALLED(QueryStatus_SETPROGRESSTEXT);
CHECK_CALLED(Exec_SETPROGRESSMAX);
CHECK_CALLED(Exec_SETPROGRESSPOS);
......
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