Commit 0d15ad8b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Move client site ifaces to HTMLDocumentObj.

parent 068489fb
......@@ -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);
......
......@@ -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,
......
......@@ -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*);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
......
......@@ -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));
}
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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);
......
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