From 98281236c0293c490ce7b35c747aff3e49d71318 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Fri, 11 Mar 2011 11:14:18 +0100 Subject: [PATCH] mshtml: Execute IDocObject_FireDocumentComplete in handle_load function. --- dlls/mshtml/mshtml_private.h | 4 ++++ dlls/mshtml/nsevents.c | 4 ++++ dlls/mshtml/oleobj.c | 28 ++++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 11ab8788448..84596fec544 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -18,6 +18,7 @@ #include "wingdi.h" #include "docobj.h" +#include "docobjectservice.h" #include "comcat.h" #include "mshtml.h" #include "mshtmhst.h" @@ -424,6 +425,7 @@ struct HTMLDocumentObj { IOleInPlaceFrame *frame; IOleInPlaceUIWindow *ip_window; IAdviseSink *view_sink; + IDocObjectService *doc_object_service; DOCHOSTUIINFO hostinfo; @@ -882,6 +884,8 @@ DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00, DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b); +DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0); + /* memory allocation functions */ static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c index f6a1ed606fa..957b892736e 100644 --- a/dlls/mshtml/nsevents.c +++ b/dlls/mshtml/nsevents.c @@ -254,6 +254,10 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event update_title(doc_obj); } + if(doc_obj && doc_obj->doc_object_service) + IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service, + &doc->basedoc.window->IHTMLWindow2_iface, 0); + if(!doc->nsdoc) { ERR("NULL nsdoc\n"); return NS_ERROR_FAILURE; diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c index f8a84ac8366..d80db208e71 100644 --- a/dlls/mshtml/oleobj.c +++ b/dlls/mshtml/oleobj.c @@ -28,17 +28,16 @@ #include "winuser.h" #include "ole2.h" #include "shlguid.h" +#include "shdeprecated.h" #include "mshtmdid.h" #include "idispids.h" #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 /********************************************************** @@ -99,6 +98,7 @@ 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; @@ -120,6 +120,11 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite This->doc_obj->hostui = NULL; } + if(This->doc_obj->doc_object_service) { + IDocObjectService_Release(This->doc_obj->doc_object_service); + This->doc_obj->doc_object_service = NULL; + } + memset(&This->doc_obj->hostinfo, 0, sizeof(DOCHOSTUIINFO)); if(!pClientSite) @@ -128,6 +133,25 @@ 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) {