diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c
index 8b9632875bc..b37ff72a847 100644
--- a/dlls/mshtml/htmldoc.c
+++ b/dlls/mshtml/htmldoc.c
@@ -1764,12 +1764,6 @@ static void destroy_htmldoc(HTMLDocument *This)
{
remove_doc_tasks(This);
- if(This->client)
- IOleObject_SetClientSite(OLEOBJ(This), NULL);
- if(This->in_place_active)
- IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
- if(This->ipsite)
- IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
if(This->undomgr)
IOleUndoManager_Release(This->undomgr);
@@ -1899,6 +1893,12 @@ static ULONG HTMLDocumentObj_Release(HTMLDocument *base)
IHTMLWindow2_Release(HTMLWINDOW2(This->basedoc.window));
}
+ if(This->client)
+ IOleObject_SetClientSite(OLEOBJ(&This->basedoc), NULL);
+ if(This->basedoc.in_place_active)
+ IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(&This->basedoc));
+ if(This->ipsite)
+ IOleDocumentView_SetInPlaceSite(DOCVIEW(&This->basedoc), NULL);
destroy_htmldoc(&This->basedoc);
if(This->basedoc.nsdoc)
remove_mutation_observer(This->nscontainer, This->basedoc.nsdoc);
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c
index 970e327d2c6..75021582739 100644
--- a/dlls/mshtml/htmlwindow.c
+++ b/dlls/mshtml/htmlwindow.c
@@ -869,10 +869,10 @@ static HRESULT WINAPI HTMLWindow2_get_external(IHTMLWindow2 *iface, IDispatch **
*p = NULL;
- if(!This->doc_obj->basedoc.hostui)
+ if(!This->doc_obj->hostui)
return S_OK;
- return IDocHostUIHandler_GetExternal(This->doc_obj->basedoc.hostui, p);
+ return IDocHostUIHandler_GetExternal(This->doc_obj->hostui, p);
}
static HRESULT HTMLWindow_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 08291902d0b..7db3b8b6881 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -284,12 +284,6 @@ struct HTMLDocument {
HTMLWindow *window;
nsIDOMHTMLDocument *nsdoc;
- IOleClientSite *client;
- IDocHostUIHandler *hostui;
- IOleInPlaceSite *ipsite;
- IOleInPlaceFrame *frame;
- IOleInPlaceUIWindow *ip_window;
-
IOleUndoManager *undomgr;
nsChannelBSC *bscallback;
@@ -354,6 +348,12 @@ struct HTMLDocumentObj {
LONG ref;
NSContainer *nscontainer;
+
+ IOleClientSite *client;
+ IDocHostUIHandler *hostui;
+ IOleInPlaceSite *ipsite;
+ IOleInPlaceFrame *frame;
+ IOleInPlaceUIWindow *ip_window;
};
typedef struct {
@@ -580,9 +580,9 @@ void init_mutation(NSContainer*);
void set_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
void remove_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
-void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
-void show_context_menu(HTMLDocument*,DWORD,POINT*,IDispatch*);
-void notif_focus(HTMLDocument*);
+void HTMLDocument_LockContainer(HTMLDocumentObj*,BOOL);
+void show_context_menu(HTMLDocumentObj*,DWORD,POINT*,IDispatch*);
+void notif_focus(HTMLDocumentObj*);
void show_tooltip(HTMLDocument*,DWORD,DWORD,LPCWSTR);
void hide_tooltip(HTMLDocument*);
@@ -706,7 +706,7 @@ void do_ns_command(HTMLDocument*,const char*,nsICommandParams*);
#define UPDATE_TITLE 0x0002
void update_doc(HTMLDocument *This, DWORD flags);
-void update_title(HTMLDocument*);
+void update_title(HTMLDocumentObj*);
/* editor */
void init_editor(HTMLDocument*);
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c
index 4e95d2b2df3..3b0571c8b9e 100644
--- a/dlls/mshtml/navigate.c
+++ b/dlls/mshtml/navigate.c
@@ -615,7 +615,7 @@ static void init_bscallback(BSCallback *This, const BSCallbackVtbl *vtbl, IMonik
}
/* Calls undocumented 84 cmd of CGID_ShellDocView */
-static void call_docview_84(HTMLDocument *doc)
+static void call_docview_84(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
VARIANT var;
@@ -714,7 +714,7 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
/* NOTE: IE7 calls IsSystemMoniker here*/
- call_docview_84(doc);
+ call_docview_84(doc->doc_obj);
if(bctx) {
RegisterBindStatusCallback(bctx, STATUSCLB(bscallback), NULL, 0);
diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c
index 8aa88a6a3d4..2bb3e017565 100644
--- a/dlls/mshtml/nsembed.c
+++ b/dlls/mshtml/nsembed.c
@@ -1139,7 +1139,7 @@ static nsresult NSAPI nsContextMenuListener_OnShowContextMenu(nsIContextMenuList
FIXME("aContextFlags=%08x\n", aContextFlags);
};
- show_context_menu(&This->doc->basedoc, dwID, &pt, (IDispatch*)HTMLDOMNODE(get_node(&This->doc->basedoc, aNode, TRUE)));
+ show_context_menu(This->doc, dwID, &pt, (IDispatch*)HTMLDOMNODE(get_node(&This->doc->basedoc, aNode, TRUE)));
return NS_OK;
}
@@ -1178,7 +1178,7 @@ static nsrefcnt NSAPI nsURIContentListener_Release(nsIURIContentListener *iface)
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
}
-static BOOL translate_url(HTMLDocument *doc, nsIWineURI *nsuri)
+static BOOL translate_url(HTMLDocumentObj *doc, nsIWineURI *nsuri)
{
OLECHAR *new_url = NULL, *url;
BOOL ret = FALSE;
@@ -1251,7 +1251,7 @@ static nsresult NSAPI nsURIContentListener_OnStartURIOpen(nsIURIContentListener
*_retval = FALSE;
}else if(This->doc) {
- *_retval = translate_url(&This->doc->basedoc.doc_obj->basedoc, wine_uri);
+ *_retval = translate_url(This->doc->basedoc.doc_obj, wine_uri);
}
nsIWineURI_Release(wine_uri);
diff --git a/dlls/mshtml/nsevents.c b/dlls/mshtml/nsevents.c
index dc64ff3aea2..cb187ddd229 100644
--- a/dlls/mshtml/nsevents.c
+++ b/dlls/mshtml/nsevents.c
@@ -93,7 +93,7 @@ static nsresult NSAPI handle_blur(nsIDOMEventListener *iface, nsIDOMEvent *event
if(!This->reset_focus && This->doc && This->doc->basedoc.doc_obj->basedoc.focus && !is_doc_child_focus(This)) {
This->doc->basedoc.doc_obj->basedoc.focus = FALSE;
- notif_focus(&This->doc->basedoc);
+ notif_focus(This->doc->basedoc.doc_obj);
}
return NS_OK;
@@ -107,7 +107,7 @@ static nsresult NSAPI handle_focus(nsIDOMEventListener *iface, nsIDOMEvent *even
if(!This->reset_focus && This->doc && !This->doc->basedoc.focus) {
This->doc->basedoc.focus = TRUE;
- notif_focus(&This->doc->basedoc);
+ notif_focus(This->doc->basedoc.doc_obj);
}
return NS_OK;
diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c
index f76584a5253..ee3df0d7053 100644
--- a/dlls/mshtml/nsio.c
+++ b/dlls/mshtml/nsio.c
@@ -103,8 +103,7 @@ static BOOL exec_shldocvw_67(HTMLDocumentObj *doc, LPCWSTR url)
IOleCommandTarget *cmdtrg = NULL;
HRESULT hres;
- hres = IOleClientSite_QueryInterface(doc->basedoc.client, &IID_IOleCommandTarget,
- (void**)&cmdtrg);
+ hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT varUrl, varRes;
@@ -149,13 +148,13 @@ static BOOL before_async_open(nsChannel *channel, NSContainer *container)
doc = container_iter->doc;
}
- if(!doc->basedoc.client)
+ if(!doc->client)
return TRUE;
if(!hlnf && !exec_shldocvw_67(doc, uri))
return FALSE;
- hres = IOleClientSite_QueryInterface(doc->basedoc.client, &IID_IServiceProvider,
+ hres = IOleClientSite_QueryInterface(doc->client, &IID_IServiceProvider,
(void**)&service_provider);
if(SUCCEEDED(hres)) {
IHlinkFrame *hlink_frame;
diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c
index 35182b4cdd4..06baba40ce9 100644
--- a/dlls/mshtml/olecmd.c
+++ b/dlls/mshtml/olecmd.c
@@ -552,15 +552,15 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
}
}
- if(This->frame)
- IOleInPlaceFrame_SetStatusText(This->frame, NULL);
+ if(This->doc_obj->frame)
+ IOleInPlaceFrame_SetStatusText(This->doc_obj->frame, NULL);
This->readystate = READYSTATE_UNINITIALIZED;
- if(This->client) {
+ if(This->doc_obj->client) {
IOleCommandTarget *cmdtrg;
- hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
+ hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT var;
@@ -573,12 +573,12 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
}
}
- if(This->hostui) {
+ if(This->doc_obj->hostui) {
DOCHOSTUIINFO hostinfo;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
- hres = IDocHostUIHandler_GetHostInfo(This->hostui, &hostinfo);
+ hres = IDocHostUIHandler_GetHostInfo(This->doc_obj->hostui, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
@@ -610,10 +610,10 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
return hres;
if(This->ui_active) {
- if(This->ip_window)
- call_set_active_object(This->ip_window, NULL);
- if(This->hostui)
- IDocHostUIHandler_HideUI(This->hostui);
+ if(This->doc_obj->ip_window)
+ call_set_active_object(This->doc_obj->ip_window, NULL);
+ if(This->doc_obj->hostui)
+ IDocHostUIHandler_HideUI(This->doc_obj->hostui);
}
if(This->doc_obj->nscontainer)
@@ -622,16 +622,16 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
if(This->ui_active) {
RECT rcBorderWidths;
- if(This->hostui)
- IDocHostUIHandler_ShowUI(This->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
- This->frame, This->ip_window);
+ if(This->doc_obj->hostui)
+ IDocHostUIHandler_ShowUI(This->doc_obj->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
+ This->doc_obj->frame, This->doc_obj->ip_window);
- if(This->ip_window)
- call_set_active_object(This->ip_window, ACTOBJ(This));
+ if(This->doc_obj->ip_window)
+ call_set_active_object(This->doc_obj->ip_window, ACTOBJ(This));
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
- if (This->frame)
- IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
+ if(This->doc_obj->frame)
+ IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
}
return S_OK;
@@ -792,8 +792,8 @@ static HRESULT WINAPI OleCommandTarget_QueryStatus(IOleCommandTarget *iface, con
OLECMD olecmd;
prgCmds[i].cmdf = OLECMDF_SUPPORTED;
- if(This->client) {
- hr = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
+ if(This->doc_obj->client) {
+ hr = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hr)) {
olecmd.cmdID = prgCmds[i].cmdID;
@@ -897,14 +897,14 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
OleCommandTarget_Exec
};
-void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt, IDispatch *elem)
+void show_context_menu(HTMLDocumentObj *This, DWORD dwID, POINT *ppt, IDispatch *elem)
{
HMENU menu_res, menu;
DWORD cmdid;
HRESULT hres;
hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt,
- (IUnknown*)CMDTARGET(This), elem);
+ (IUnknown*)CMDTARGET(&This->basedoc), elem);
if(hres == S_OK)
return;
@@ -912,11 +912,11 @@ void show_context_menu(HTMLDocument *This, DWORD dwID, POINT *ppt, IDispatch *el
menu = GetSubMenu(menu_res, dwID);
cmdid = TrackPopupMenu(menu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD,
- ppt->x, ppt->y, 0, This->hwnd, NULL);
+ ppt->x, ppt->y, 0, This->basedoc.hwnd, NULL);
DestroyMenu(menu_res);
if(cmdid)
- IOleCommandTarget_Exec(CMDTARGET(This), &CGID_MSHTML, cmdid, 0, NULL, NULL);
+ IOleCommandTarget_Exec(CMDTARGET(&This->basedoc), &CGID_MSHTML, cmdid, 0, NULL, NULL);
}
void HTMLDocument_OleCmd_Init(HTMLDocument *This)
diff --git a/dlls/mshtml/oleobj.c b/dlls/mshtml/oleobj.c
index 2c4af5c7220..b0a097f1432 100644
--- a/dlls/mshtml/oleobj.c
+++ b/dlls/mshtml/oleobj.c
@@ -97,18 +97,18 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
TRACE("(%p)->(%p)\n", This, pClientSite);
- if(pClientSite == This->client)
+ if(pClientSite == This->doc_obj->client)
return S_OK;
- if(This->client) {
- IOleClientSite_Release(This->client);
- This->client = NULL;
+ if(This->doc_obj->client) {
+ IOleClientSite_Release(This->doc_obj->client);
+ This->doc_obj->client = NULL;
This->usermode = UNKNOWN_USERMODE;
}
- if(This->hostui) {
- IDocHostUIHandler_Release(This->hostui);
- This->hostui = NULL;
+ if(This->doc_obj->hostui) {
+ IDocHostUIHandler_Release(This->doc_obj->hostui);
+ This->doc_obj->hostui = NULL;
}
memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
@@ -192,15 +192,15 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
}
IOleClientSite_AddRef(pClientSite);
- This->client = pClientSite;
- This->hostui = pDocHostUIHandler;
+ This->doc_obj->client = pClientSite;
+ This->doc_obj->hostui = pDocHostUIHandler;
if(This->usermode == UNKNOWN_USERMODE)
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
+ hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
WARN("V_VT(silent) = %d\n", V_VT(&silent));
@@ -223,9 +223,9 @@ static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite
if(!ppClientSite)
return E_INVALIDARG;
- if(This->client)
- IOleClientSite_AddRef(This->client);
- *ppClientSite = This->client;
+ if(This->doc_obj->client)
+ IOleClientSite_AddRef(This->doc_obj->client);
+ *ppClientSite = This->doc_obj->client;
return S_OK;
}
@@ -249,7 +249,7 @@ static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
if(This->in_place_active)
IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
- HTMLDocument_LockContainer(This, FALSE);
+ HTMLDocument_LockContainer(This->doc_obj, FALSE);
return S_OK;
}
@@ -298,11 +298,11 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpms
}
if(!pActiveSite)
- pActiveSite = This->client;
+ pActiveSite = This->doc_obj->client;
hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite);
if(SUCCEEDED(hres)) {
- HTMLDocument_LockContainer(This, TRUE);
+ HTMLDocument_LockContainer(This->doc_obj, TRUE);
/* FIXME: Create new IOleDocumentView. See CreateView for more info. */
hres = IOleDocumentSite_ActivateMe(pDocSite, DOCVIEW(This));
@@ -589,7 +589,7 @@ static HRESULT on_change_dlcontrol(HTMLDocument *This)
VARIANT res;
HRESULT hres;
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_DLCONTROL, &res);
+ hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_DLCONTROL, &res);
if(SUCCEEDED(hres))
FIXME("unsupported dlcontrol %08x\n", V_I4(&res));
@@ -599,18 +599,20 @@ static HRESULT on_change_dlcontrol(HTMLDocument *This)
static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
{
HTMLDocument *This = CONTROL_THIS(iface);
+ IOleClientSite *client;
VARIANT res;
HRESULT hres;
- if(!This->client) {
- TRACE("This->client = NULL\n");
+ client = This->doc_obj->client;
+ if(!client) {
+ TRACE("client = NULL\n");
return S_OK;
}
switch(dispID) {
case DISPID_AMBIENT_USERMODE:
TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERMODE, &res);
+ hres = get_client_disp_property(client, DISPID_AMBIENT_USERMODE, &res);
if(FAILED(hres))
return S_OK;
@@ -631,7 +633,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This);
on_change_dlcontrol(This);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
+ hres = get_client_disp_property(client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
if(FAILED(hres))
return S_OK;
@@ -647,7 +649,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
case DISPID_AMBIENT_SILENT:
TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This);
on_change_dlcontrol(This);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &res);
+ hres = get_client_disp_property(client, DISPID_AMBIENT_SILENT, &res);
if(FAILED(hres))
return S_OK;
@@ -662,7 +664,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
return S_OK;
case DISPID_AMBIENT_USERAGENT:
TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_USERAGENT, &res);
+ hres = get_client_disp_property(client, DISPID_AMBIENT_USERAGENT, &res);
if(FAILED(hres))
return S_OK;
@@ -671,7 +673,7 @@ static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DIS
return S_OK;
case DISPID_AMBIENT_PALETTE:
TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This);
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_PALETTE, &res);
+ hres = get_client_disp_property(client, DISPID_AMBIENT_PALETTE, &res);
if(FAILED(hres))
return S_OK;
@@ -743,18 +745,18 @@ static const ICustomDocVtbl CustomDocVtbl = {
CustomDoc_SetUIHandler
};
-void HTMLDocument_LockContainer(HTMLDocument *This, BOOL fLock)
+void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
{
IOleContainer *container;
HRESULT hres;
- if(!This->client || This->container_locked == fLock)
+ if(!This->client || This->basedoc.container_locked == fLock)
return;
hres = IOleClientSite_GetContainer(This->client, &container);
if(SUCCEEDED(hres)) {
IOleContainer_LockContainer(container, fLock);
- This->container_locked = fLock;
+ This->basedoc.container_locked = fLock;
IOleContainer_Release(container);
}
}
@@ -767,12 +769,4 @@ void HTMLDocument_OleObj_Init(HTMLDocument *This)
This->lpCustomDocVtbl = &CustomDocVtbl;
This->usermode = UNKNOWN_USERMODE;
-
- This->client = NULL;
- This->hostui = NULL;
-
- This->has_key_path = FALSE;
- This->container_locked = FALSE;
-
- memset(&This->hostinfo, 0, sizeof(DOCHOSTUIINFO));
}
diff --git a/dlls/mshtml/olewnd.c b/dlls/mshtml/olewnd.c
index 5ce3209f447..a223fdaea10 100644
--- a/dlls/mshtml/olewnd.c
+++ b/dlls/mshtml/olewnd.c
@@ -98,8 +98,8 @@ static HRESULT WINAPI OleInPlaceActiveObject_OnFrameWindowActivate(IOleInPlaceAc
TRACE("(%p)->(%x)\n", This, fActivate);
- if(This->hostui)
- IDocHostUIHandler_OnFrameWindowActivate(This->hostui, fActivate);
+ if(This->doc_obj->hostui)
+ IDocHostUIHandler_OnFrameWindowActivate(This->doc_obj->hostui, fActivate);
return S_OK;
}
@@ -193,8 +193,8 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
if(!This->in_place_active)
return S_OK;
- if(This->frame)
- IOleInPlaceFrame_Release(This->frame);
+ if(This->doc_obj->frame)
+ IOleInPlaceFrame_Release(This->doc_obj->frame);
if(This->hwnd) {
ShowWindow(This->hwnd, SW_HIDE);
@@ -202,19 +202,19 @@ static HRESULT WINAPI OleInPlaceObjectWindowless_InPlaceDeactivate(IOleInPlaceOb
}
This->focus = FALSE;
- notif_focus(This);
+ notif_focus(This->doc_obj);
This->in_place_active = FALSE;
- if(This->ipsite) {
+ if(This->doc_obj->ipsite) {
IOleInPlaceSiteEx *ipsiteex;
HRESULT hres;
- hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
+ hres = IOleInPlaceSite_QueryInterface(This->doc_obj->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
if(SUCCEEDED(hres)) {
IOleInPlaceSiteEx_OnInPlaceDeactivateEx(ipsiteex, TRUE);
IOleInPlaceSiteEx_Release(ipsiteex);
}else {
- IOleInPlaceSite_OnInPlaceDeactivate(This->ipsite);
+ IOleInPlaceSite_OnInPlaceDeactivate(This->doc_obj->ipsite);
}
}
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index 6930bb9a3c5..872ed1e6494 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -117,7 +117,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
call_property_onchanged(&This->cp_propnotif, DISPID_READYSTATE);
update_doc(This, UPDATE_TITLE);
- HTMLDocument_LockContainer(This, TRUE);
+ HTMLDocument_LockContainer(This->doc_obj, TRUE);
hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
if(FAILED(hres)) {
@@ -129,11 +129,11 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
set_current_mon(This, mon);
- if(This->client) {
+ if(This->doc_obj->client) {
VARIANT silent, offline;
IOleCommandTarget *cmdtrg = NULL;
- hres = get_client_disp_property(This->client, DISPID_AMBIENT_SILENT, &silent);
+ hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
WARN("V_VT(silent) = %d\n", V_VT(&silent));
@@ -141,7 +141,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
FIXME("silent == true\n");
}
- hres = get_client_disp_property(This->client,
+ hres = get_client_disp_property(This->doc_obj->client,
DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &offline);
if(SUCCEEDED(hres)) {
if(V_VT(&silent) != VT_BOOL)
@@ -150,7 +150,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
FIXME("offline == true\n");
}
- hres = IOleClientSite_QueryInterface(This->client, &IID_IOleCommandTarget,
+ hres = IOleClientSite_QueryInterface(This->doc_obj->client, &IID_IOleCommandTarget,
(void**)&cmdtrg);
if(SUCCEEDED(hres)) {
VARIANT var;
@@ -165,7 +165,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
bscallback = create_channelbsc(mon);
- if(This->frame) {
+ if(This->doc_obj->frame) {
task = heap_alloc(sizeof(task_t));
task->doc = This;
diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c
index 61040e89721..cdeeccb56dc 100644
--- a/dlls/mshtml/task.c
+++ b/dlls/mshtml/task.c
@@ -191,7 +191,7 @@ HRESULT clear_task_timer(HTMLDocument *doc, BOOL interval, DWORD id)
return S_OK;
}
-static void set_downloading(HTMLDocument *doc)
+static void set_downloading(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
HRESULT hres;
@@ -228,7 +228,7 @@ static void set_downloading(HTMLDocument *doc)
}
/* Calls undocumented 69 cmd of CGID_Explorer */
-static void call_explorer_69(HTMLDocument *doc)
+static void call_explorer_69(HTMLDocumentObj *doc)
{
IOleCommandTarget *olecmd;
VARIANT var;
@@ -257,17 +257,17 @@ static void set_parsecomplete(HTMLDocument *doc)
if(doc->usermode == EDITMODE)
init_editor(doc);
- call_explorer_69(doc);
+ call_explorer_69(doc->doc_obj);
call_property_onchanged(&doc->cp_propnotif, 1005);
- call_explorer_69(doc);
+ call_explorer_69(doc->doc_obj);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
doc->readystate = READYSTATE_INTERACTIVE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
- if(doc->client)
- IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
+ if(doc->doc_obj->client)
+ IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT state, progress;
@@ -292,12 +292,12 @@ static void set_parsecomplete(HTMLDocument *doc)
doc->readystate = READYSTATE_COMPLETE;
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
- if(doc->frame) {
+ if(doc->doc_obj->frame) {
static const WCHAR wszDone[] = {'D','o','n','e',0};
- IOleInPlaceFrame_SetStatusText(doc->frame, wszDone);
+ IOleInPlaceFrame_SetStatusText(doc->doc_obj->frame, wszDone);
}
- update_title(doc);
+ update_title(doc->doc_obj);
}
static void set_progress(HTMLDocument *doc)
@@ -307,8 +307,8 @@ static void set_progress(HTMLDocument *doc)
TRACE("(%p)\n", doc);
- if(doc->client)
- IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&olecmd);
+ if(doc->doc_obj->client)
+ IOleClientSite_QueryInterface(doc->doc_obj->client, &IID_IOleCommandTarget, (void**)&olecmd);
if(olecmd) {
VARIANT progress_max, progress;
@@ -324,12 +324,12 @@ static void set_progress(HTMLDocument *doc)
&progress, NULL);
}
- if(doc->usermode == EDITMODE && doc->hostui) {
+ if(doc->usermode == EDITMODE && doc->doc_obj->hostui) {
DOCHOSTUIINFO hostinfo;
memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
- hres = IDocHostUIHandler_GetHostInfo(doc->hostui, &hostinfo);
+ hres = IDocHostUIHandler_GetHostInfo(doc->doc_obj->hostui, &hostinfo);
if(SUCCEEDED(hres))
/* FIXME: use hostinfo */
TRACE("hostinfo = {%u %08x %08x %s %s}\n",
@@ -349,7 +349,7 @@ static void process_task(task_t *task)
{
switch(task->task_id) {
case TASK_SETDOWNLOADSTATE:
- set_downloading(task->doc);
+ set_downloading(task->doc->doc_obj);
break;
case TASK_PARSECOMPLETE:
set_parsecomplete(task->doc);
diff --git a/dlls/mshtml/view.c b/dlls/mshtml/view.c
index cb1d752c4e2..1131c07f7ca 100644
--- a/dlls/mshtml/view.c
+++ b/dlls/mshtml/view.c
@@ -103,15 +103,15 @@ void update_doc(HTMLDocument *This, DWORD flags)
This->update |= flags;
}
-void update_title(HTMLDocument *This)
+void update_title(HTMLDocumentObj *This)
{
IOleCommandTarget *olecmd;
HRESULT hres;
- if(!(This->update & UPDATE_TITLE))
+ if(!(This->basedoc.update & UPDATE_TITLE))
return;
- This->update &= ~UPDATE_TITLE;
+ This->basedoc.update &= ~UPDATE_TITLE;
if(!This->client)
return;
@@ -131,16 +131,16 @@ void update_title(HTMLDocument *This)
}
}
-static LRESULT on_timer(HTMLDocument *This)
+static LRESULT on_timer(HTMLDocumentObj *This)
{
- TRACE("(%p) %x\n", This, This->update);
+ TRACE("(%p) %x\n", This, This->basedoc.update);
- KillTimer(This->hwnd, TIMER_ID);
+ KillTimer(This->basedoc.hwnd, TIMER_ID);
- if(!This->update)
+ if(!This->basedoc.update)
return 0;
- if(This->update & UPDATE_UI) {
+ if(This->basedoc.update & UPDATE_UI) {
if(This->hostui)
IDocHostUIHandler_UpdateUI(This->hostui);
@@ -159,11 +159,11 @@ static LRESULT on_timer(HTMLDocument *This)
}
update_title(This);
- This->update = 0;
+ This->basedoc.update = 0;
return 0;
}
-void notif_focus(HTMLDocument *This)
+void notif_focus(HTMLDocumentObj *This)
{
IOleControlSite *site;
HRESULT hres;
@@ -175,7 +175,7 @@ void notif_focus(HTMLDocument *This)
if(FAILED(hres))
return;
- IOleControlSite_OnFocus(site, This->focus);
+ IOleControlSite_OnFocus(site, This->basedoc.focus);
IOleControlSite_Release(site);
}
@@ -215,7 +215,7 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
break;
case WM_TIMER:
- return on_timer(This);
+ return on_timer(This->doc_obj);
case WM_MOUSEACTIVATE:
return MA_ACTIVATE;
}
@@ -237,7 +237,7 @@ static void register_serverwnd_class(void)
serverwnd_class = RegisterClassExW(&wndclass);
}
-static HRESULT activate_window(HTMLDocument *This)
+static HRESULT activate_window(HTMLDocumentObj *This)
{
IOleInPlaceFrame *pIPFrame;
IOleCommandTarget *cmdtrg;
@@ -276,10 +276,10 @@ static HRESULT activate_window(HTMLDocument *This)
TRACE("got parent window %p\n", parent_hwnd);
- if(This->hwnd) {
- if(GetParent(This->hwnd) != parent_hwnd)
- SetParent(This->hwnd, parent_hwnd);
- SetWindowPos(This->hwnd, HWND_TOP,
+ if(This->basedoc.hwnd) {
+ if(GetParent(This->basedoc.hwnd) != parent_hwnd)
+ SetParent(This->basedoc.hwnd, parent_hwnd);
+ SetWindowPos(This->basedoc.hwnd, HWND_TOP,
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
SWP_NOACTIVATE | SWP_SHOWWINDOW);
}else {
@@ -288,23 +288,23 @@ static HRESULT activate_window(HTMLDocument *This)
posrect.left, posrect.top, posrect.right-posrect.left, posrect.bottom-posrect.top,
parent_hwnd, NULL, hInst, This);
- TRACE("Created window %p\n", This->hwnd);
+ TRACE("Created window %p\n", This->basedoc.hwnd);
- SetWindowPos(This->hwnd, NULL, 0, 0, 0, 0,
+ SetWindowPos(This->basedoc.hwnd, NULL, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOACTIVATE | SWP_SHOWWINDOW);
- RedrawWindow(This->hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
+ RedrawWindow(This->basedoc.hwnd, NULL, NULL, RDW_INVALIDATE | RDW_NOERASE | RDW_ALLCHILDREN);
/* NOTE:
* Windows implementation calls:
* RegisterWindowMessage("MSWHEEL_ROLLMSG");
*/
- SetTimer(This->hwnd, TIMER_ID, 100, NULL);
+ SetTimer(This->basedoc.hwnd, TIMER_ID, 100, NULL);
}
- if(This->doc_obj->nscontainer)
- activate_gecko(This->doc_obj->nscontainer);
+ if(This->nscontainer)
+ activate_gecko(This->nscontainer);
- This->in_place_active = TRUE;
+ This->basedoc.in_place_active = TRUE;
hres = IOleInPlaceSite_QueryInterface(This->ipsite, &IID_IOleInPlaceSiteEx, (void**)&ipsiteex);
if(SUCCEEDED(hres)) {
BOOL redraw = FALSE;
@@ -318,7 +318,7 @@ static HRESULT activate_window(HTMLDocument *This)
}
if(FAILED(hres)) {
WARN("OnInPlaceActivate failed: %08x\n", hres);
- This->in_place_active = FALSE;
+ This->basedoc.in_place_active = FALSE;
return hres;
}
@@ -342,7 +342,7 @@ static HRESULT activate_window(HTMLDocument *This)
IOleInPlaceFrame_Release(This->frame);
This->frame = pIPFrame;
- This->window_active = TRUE;
+ This->basedoc.window_active = TRUE;
return S_OK;
}
@@ -462,10 +462,10 @@ static HRESULT WINAPI OleDocumentView_SetInPlaceSite(IOleDocumentView *iface, IO
if(pIPSite)
IOleInPlaceSite_AddRef(pIPSite);
- if(This->ipsite)
- IOleInPlaceSite_Release(This->ipsite);
+ if(This->doc_obj->ipsite)
+ IOleInPlaceSite_Release(This->doc_obj->ipsite);
- This->ipsite = pIPSite;
+ This->doc_obj->ipsite = pIPSite;
return S_OK;
}
@@ -477,10 +477,10 @@ static HRESULT WINAPI OleDocumentView_GetInPlaceSite(IOleDocumentView *iface, IO
if(!ppIPSite)
return E_INVALIDARG;
- if(This->ipsite)
- IOleInPlaceSite_AddRef(This->ipsite);
+ if(This->doc_obj->ipsite)
+ IOleInPlaceSite_AddRef(This->doc_obj->ipsite);
- *ppIPSite = This->ipsite;
+ *ppIPSite = This->doc_obj->ipsite;
return S_OK;
}
@@ -549,7 +549,7 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
if(fShow) {
if(!This->ui_active) {
- hres = activate_window(This);
+ hres = activate_window(This->doc_obj);
if(FAILED(hres))
return hres;
}
@@ -557,9 +557,9 @@ static HRESULT WINAPI OleDocumentView_Show(IOleDocumentView *iface, BOOL fShow)
ShowWindow(This->hwnd, SW_SHOW);
}else {
ShowWindow(This->hwnd, SW_HIDE);
- if(This->ip_window) {
- IOleInPlaceUIWindow_Release(This->ip_window);
- This->ip_window = NULL;
+ if(This->doc_obj->ip_window) {
+ IOleInPlaceUIWindow_Release(This->doc_obj->ip_window);
+ This->doc_obj->ip_window = NULL;
}
}
@@ -573,7 +573,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
TRACE("(%p)->(%x)\n", This, fUIActivate);
- if(!This->ipsite) {
+ if(!This->doc_obj->ipsite) {
FIXME("This->ipsite = NULL\n");
return E_FAIL;
}
@@ -585,7 +585,7 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
return S_OK;
if(!This->window_active) {
- hres = activate_window(This);
+ hres = activate_window(This->doc_obj);
if(FAILED(hres))
return hres;
}
@@ -593,47 +593,47 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
This->focus = TRUE;
if(This->doc_obj->nscontainer)
nsIWebBrowserFocus_Activate(This->doc_obj->nscontainer->focus);
- notif_focus(This);
+ notif_focus(This->doc_obj);
update_doc(This, UPDATE_UI);
- hres = IOleInPlaceSite_OnUIActivate(This->ipsite);
+ hres = IOleInPlaceSite_OnUIActivate(This->doc_obj->ipsite);
if(SUCCEEDED(hres)) {
- call_set_active_object((IOleInPlaceUIWindow*)This->frame, ACTOBJ(This));
+ call_set_active_object((IOleInPlaceUIWindow*)This->doc_obj->frame, ACTOBJ(This));
}else {
FIXME("OnUIActivate failed: %08x\n", hres);
- IOleInPlaceFrame_Release(This->frame);
- This->frame = NULL;
+ IOleInPlaceFrame_Release(This->doc_obj->frame);
+ This->doc_obj->frame = NULL;
This->ui_active = FALSE;
return hres;
}
- if(This->hostui) {
- hres = IDocHostUIHandler_ShowUI(This->hostui,
+ if(This->doc_obj->hostui) {
+ hres = IDocHostUIHandler_ShowUI(This->doc_obj->hostui,
This->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
- ACTOBJ(This), CMDTARGET(This), This->frame, This->ip_window);
+ ACTOBJ(This), CMDTARGET(This), This->doc_obj->frame, This->doc_obj->ip_window);
if(FAILED(hres))
- IDocHostUIHandler_HideUI(This->hostui);
+ IDocHostUIHandler_HideUI(This->doc_obj->hostui);
}
- if(This->ip_window)
- call_set_active_object(This->ip_window, ACTOBJ(This));
+ if(This->doc_obj->ip_window)
+ call_set_active_object(This->doc_obj->ip_window, ACTOBJ(This));
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
- IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
+ IOleInPlaceFrame_SetBorderSpace(This->doc_obj->frame, &rcBorderWidths);
This->ui_active = TRUE;
}else {
if(This->ui_active) {
This->ui_active = FALSE;
- if(This->ip_window)
- call_set_active_object(This->ip_window, NULL);
- if(This->frame)
- call_set_active_object((IOleInPlaceUIWindow*)This->frame, NULL);
- if(This->hostui)
- IDocHostUIHandler_HideUI(This->hostui);
- if(This->ipsite)
- IOleInPlaceSite_OnUIDeactivate(This->ipsite, FALSE);
+ if(This->doc_obj->ip_window)
+ call_set_active_object(This->doc_obj->ip_window, NULL);
+ if(This->doc_obj->frame)
+ call_set_active_object((IOleInPlaceUIWindow*)This->doc_obj->frame, NULL);
+ if(This->doc_obj->hostui)
+ IDocHostUIHandler_HideUI(This->doc_obj->hostui);
+ if(This->doc_obj->ipsite)
+ IOleInPlaceSite_OnUIDeactivate(This->doc_obj->ipsite, FALSE);
}
}
return S_OK;
@@ -805,17 +805,4 @@ void HTMLDocument_View_Init(HTMLDocument *This)
{
This->lpOleDocumentViewVtbl = &OleDocumentViewVtbl;
This->lpViewObject2Vtbl = &ViewObjectVtbl;
-
- This->ipsite = NULL;
- This->frame = NULL;
- This->ip_window = NULL;
- This->hwnd = NULL;
- This->tooltips_hwnd = NULL;
-
- This->in_place_active = FALSE;
- This->ui_active = FALSE;
- This->window_active = FALSE;
- This->focus = FALSE;
-
- This->update = 0;
}