Commit 98680070 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Use QueryService helper function in SetClientSite implementation.

parent 6363796e
......@@ -203,41 +203,34 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
if(!hostui_setup) {
IServiceProvider *sp;
IDocObjectService *doc_object_service;
IBrowserService *browser_service;
IWebBrowser2 *wb;
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);
hres = do_query_service((IUnknown*)pClientSite, &IID_IShellBrowser,
&IID_IBrowserService, (void**)&browser_service);
if(SUCCEEDED(hres)) {
IDocObjectService *doc_object_service;
IBrowserService *browser_service;
IWebBrowser2 *wb;
hres = IServiceProvider_QueryService(sp, &IID_IShellBrowser,
&IID_IBrowserService, (void**)&browser_service);
hres = IBrowserService_QueryInterface(browser_service,
&IID_IDocObjectService, (void**)&doc_object_service);
if(SUCCEEDED(hres)) {
hres = IBrowserService_QueryInterface(browser_service,
&IID_IDocObjectService, (void**)&doc_object_service);
This->doc_obj->doc_object_service = doc_object_service;
/*
* Some embedding routines, esp. in regards to use of IDocObjectService, differ if
* embedder supports IWebBrowserApp.
*/
hres = do_query_service((IUnknown*)pClientSite, &IID_IWebBrowserApp, &IID_IWebBrowser2, (void**)&wb);
if(SUCCEEDED(hres)) {
This->doc_obj->doc_object_service = doc_object_service;
/*
* Some embedding routines, esp. in regards to use of IDocObjectService, differ if
* embedder supports IWebBrowserApp.
*/
hres = IServiceProvider_QueryService(sp, &IID_IWebBrowserApp, &IID_IWebBrowser2, (void**)&wb);
if(SUCCEEDED(hres)) {
This->doc_obj->is_webbrowser = TRUE;
IWebBrowser2_Release(wb);
}
This->doc_obj->is_webbrowser = TRUE;
IWebBrowser2_Release(wb);
}
IBrowserService_Release(browser_service);
}
IServiceProvider_Release(sp);
}
}
......
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