mshtml: Moved QueryService(IID_IShellBrowser) call to the right place.

This commit is contained in:
Jacek Caban 2011-11-12 14:54:09 +01:00 committed by Alexandre Julliard
parent dc604f4a27
commit 54faf0852f
1 changed files with 20 additions and 20 deletions

View File

@ -98,7 +98,6 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
HTMLDocument *This = impl_from_IOleObject(iface); HTMLDocument *This = impl_from_IOleObject(iface);
IOleCommandTarget *cmdtrg = NULL; IOleCommandTarget *cmdtrg = NULL;
IOleWindow *ole_window; IOleWindow *ole_window;
IServiceProvider *sp;
BOOL hostui_setup; BOOL hostui_setup;
VARIANT silent; VARIANT silent;
HWND hwnd; HWND hwnd;
@ -133,25 +132,6 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
IOleClientSite_AddRef(pClientSite); IOleClientSite_AddRef(pClientSite);
This->doc_obj->client = pClientSite; This->doc_obj->client = pClientSite;
hres = IOleClientSite_QueryInterface(pClientSite, &IID_IServiceProvider, (void**)&sp);
if(SUCCEEDED(hres)) {
IBrowserService *browser_service;
IDocObjectService *doc_object_service;
hres = IServiceProvider_QueryService(sp, &IID_IShellBrowser,
&IID_IBrowserService, (void**)&browser_service);
if(SUCCEEDED(hres)) {
hres = IBrowserService_QueryInterface(browser_service,
&IID_IDocObjectService, (void**)&doc_object_service);
if(SUCCEEDED(hres))
This->doc_obj->doc_object_service = doc_object_service;
IBrowserService_Release(browser_service);
}
IServiceProvider_Release(sp);
}
hostui_setup = This->doc_obj->hostui_setup; hostui_setup = This->doc_obj->hostui_setup;
if(!This->doc_obj->hostui) { if(!This->doc_obj->hostui) {
@ -222,9 +202,29 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0}; OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
if(!hostui_setup) { if(!hostui_setup) {
IServiceProvider *sp;
V_VT(&var) = VT_UNKNOWN; V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface; V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface;
IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL); IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
hres = IOleClientSite_QueryInterface(pClientSite, &IID_IServiceProvider, (void**)&sp);
if(SUCCEEDED(hres)) {
IDocObjectService *doc_object_service;
IBrowserService *browser_service;
hres = IServiceProvider_QueryService(sp, &IID_IShellBrowser,
&IID_IBrowserService, (void**)&browser_service);
if(SUCCEEDED(hres)) {
hres = IBrowserService_QueryInterface(browser_service,
&IID_IDocObjectService, (void**)&doc_object_service);
if(SUCCEEDED(hres))
This->doc_obj->doc_object_service = doc_object_service;
IBrowserService_Release(browser_service);
}
IServiceProvider_Release(sp);
}
} }
IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL); IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);