mshtml: Move most code from handle_editor_load to exec_editmode.

This commit is contained in:
Jacek Caban 2007-10-07 10:48:35 +02:00 committed by Alexandre Julliard
parent fdfa760c85
commit 99e6592c9d
2 changed files with 29 additions and 24 deletions

View File

@ -505,29 +505,6 @@ void handle_edit_event(HTMLDocument *This, nsIDOMEvent *event)
void handle_edit_load(HTMLDocument *This)
{
get_editor_controller(This->nscontainer);
if(This->ui_active) {
OLECHAR wszHTMLDocument[30];
RECT rcBorderWidths;
if(This->ip_window)
IOleInPlaceUIWindow_SetActiveObject(This->ip_window, NULL, NULL);
if(This->hostui)
IDocHostUIHandler_HideUI(This->hostui);
if(This->hostui)
IDocHostUIHandler_ShowUI(This->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
This->frame, This->ip_window);
LoadStringW(hInst, IDS_HTMLDOCUMENT, wszHTMLDocument,
sizeof(wszHTMLDocument)/sizeof(WCHAR));
if(This->ip_window)
IOleInPlaceUIWindow_SetActiveObject(This->ip_window, ACTOBJ(This), wszHTMLDocument);
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
}
}
static void set_ns_fontname(NSContainer *This, const char *fontname)

View File

@ -583,7 +583,35 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
update_doc(This, UPDATE_UI);
return IPersistMoniker_Load(PERSISTMON(This), TRUE, mon, NULL, 0);
hres = IPersistMoniker_Load(PERSISTMON(This), TRUE, mon, NULL, 0);
IMoniker_Release(mon);
if(FAILED(hres))
return hres;
if(This->ui_active) {
OLECHAR wszHTMLDocument[30];
RECT rcBorderWidths;
if(This->ip_window)
IOleInPlaceUIWindow_SetActiveObject(This->ip_window, NULL, NULL);
if(This->hostui)
IDocHostUIHandler_HideUI(This->hostui);
if(This->hostui)
IDocHostUIHandler_ShowUI(This->hostui, DOCHOSTUITYPE_AUTHOR, ACTOBJ(This), CMDTARGET(This),
This->frame, This->ip_window);
LoadStringW(hInst, IDS_HTMLDOCUMENT, wszHTMLDocument,
sizeof(wszHTMLDocument)/sizeof(WCHAR));
if(This->ip_window)
IOleInPlaceUIWindow_SetActiveObject(This->ip_window, ACTOBJ(This), wszHTMLDocument);
memset(&rcBorderWidths, 0, sizeof(rcBorderWidths));
IOleInPlaceFrame_SetBorderSpace(This->frame, &rcBorderWidths);
}
return S_OK;
}
static HRESULT exec_htmleditmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)