mshtml: Added IDM_SETDIRTY implementation.
diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 20db6ee..51f5f26 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c
@@ -99,6 +99,24 @@ static const WCHAR wszFont[] = {'f','o','n','t',0}; static const WCHAR wszSize[] = {'s','i','z','e',0}; +static void set_dirty(HTMLDocument *This, VARIANT_BOOL dirty) +{ + nsresult nsres; + + if(!This->nscontainer || !This->nscontainer->editor) + return; + + if(dirty) { + nsres = nsIEditor_IncrementModificationCount(This->nscontainer->editor, 1); + if(NS_FAILED(nsres)) + ERR("IncrementModificationCount failed: %08x\n", nsres); + }else { + nsres = nsIEditor_ResetModificationCount(This->nscontainer->editor); + if(NS_FAILED(nsres)) + ERR("ResetModificationCount failed: %08x\n", nsres); + } +} + static void do_ns_editor_command(NSContainer *This, const char *cmd) { nsresult nsres; @@ -383,6 +401,8 @@ nsISelection_Release(nsselection); nsIDOMDocument_Release(nsdoc); + + set_dirty(This, VARIANT_TRUE); } static void handle_arrow_key(HTMLDocument *This, nsIDOMKeyEvent *event, const char * const cmds[4]) @@ -949,6 +969,21 @@ return S_OK; } +static HRESULT exec_setdirty(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out) +{ + TRACE("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out); + + if(!in || This->usermode != EDITMODE) + return S_OK; + + if(V_VT(in) == VT_BOOL) + set_dirty(This, V_BOOL(in)); + else + FIXME("unsupported vt=%d\n", V_VT(in)); + + return S_OK; +} + static HRESULT query_edit_status(HTMLDocument *This, OLECMD *cmd) { switch(cmd->cmdID) { @@ -1247,6 +1282,7 @@ {IDM_OUTDENT, query_edit_status, exec_outdent}, {IDM_COMPOSESETTINGS, NULL, exec_composesettings}, {IDM_HYPERLINK, query_edit_status, exec_hyperlink}, + {IDM_SETDIRTY, NULL, exec_setdirty}, {0,NULL,NULL} };
diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 96cccae..b76ea31 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c
@@ -626,12 +626,6 @@ return S_OK; } -static HRESULT exec_setdirty(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out) -{ - FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out); - return E_NOTIMPL; -} - static HRESULT exec_baselinefont3(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out) { FIXME("(%p)->(%08x %p %p)\n", This, cmdexecopt, in, out); @@ -718,7 +712,6 @@ {IDM_BROWSEMODE, NULL, exec_browsemode}, {IDM_EDITMODE, NULL, exec_editmode}, {IDM_PRINT, query_enabled_stub, exec_print}, - {IDM_SETDIRTY, NULL, exec_setdirty}, {IDM_HTMLEDITMODE, NULL, exec_htmleditmode}, {IDM_BASELINEFONT3, NULL, exec_baselinefont3}, {IDM_BLOCKDIRLTR, query_enabled_stub, NULL},