From 54faf0852fe377a009f873ecb941995dd36dd710 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sat, 12 Nov 2011 14:54:09 +0100 Subject: [PATCH] mshtml: Moved QueryService(IID_IShellBrowser) call to the right place. --- dlls/mshtml/oleobj.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index d80db208e71..fa2694e2f76 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -98,7 +98,6 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite HTMLDocument *This = impl_from_IOleObject(iface); IOleCommandTarget *cmdtrg = NULL; IOleWindow *ole_window; - IServiceProvider *sp; BOOL hostui_setup; VARIANT silent; HWND hwnd; @@ -133,25 +132,6 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite IOleClientSite_AddRef(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; if(!This->doc_obj->hostui) { @@ -222,9 +202,29 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0}; if(!hostui_setup) { + IServiceProvider *sp; + V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)&This->window->IHTMLWindow2_iface; 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);