Module: wine Branch: master Commit: 99e6592c9d73b7b4b0a7d174f64c9cab7c83c9d4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=99e6592c9d73b7b4b0a7d174f6...
Author: Jacek Caban jacek@codeweavers.com Date: Sun Oct 7 10:48:35 2007 +0200
mshtml: Move most code from handle_editor_load to exec_editmode.
---
dlls/mshtml/editor.c | 23 ----------------------- dlls/mshtml/olecmd.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 24 deletions(-)
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 239bba5..20db6ee 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -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) diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index a137057..c56dce2 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -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)