From 239b86fe8ff16c6be952421823beea36a4f55452 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 10 Jun 2007 11:37:37 +0200 Subject: [PATCH] mshtml: Don't do anything in exec_editmode if edit mode is already set. --- dlls/mshtml/olecmd.c | 3 +++ dlls/mshtml/tests/htmldoc.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 468c401fce..8c4b8cf3b0 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -523,6 +523,9 @@ static HRESULT exec_editmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, if(in || out) FIXME("unsupported args\n"); + if(This->usermode == EDITMODE) + return S_OK; + This->usermode = EDITMODE; if(This->frame) diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index 2627a8570c..083181afd3 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -2571,6 +2571,10 @@ static void test_exec_editmode(IUnknown *unk) IOleCommandTarget_Release(cmdtrg); editmode = TRUE; + + hres = IOleCommandTarget_Exec(cmdtrg, &CGID_MSHTML, IDM_EDITMODE, + OLECMDEXECOPT_DODEFAULT, NULL, NULL); + ok(hres == S_OK, "Exec failed: %08x\n", hres); } static HWND create_container_window(void)