Module: wine Branch: master Commit: a1e554739ee1a2e35bbb422d41c011bd551cbb2c URL: http://source.winehq.org/git/wine.git/?a=commit;h=a1e554739ee1a2e35bbb422d41...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Nov 9 02:23:08 2007 +0100
mshtml: Added IDM_SETDIRTY implementation.
---
dlls/mshtml/editor.c | 36 ++++++++++++++++++++++++++++++++++++ dlls/mshtml/olecmd.c | 7 ------- 2 files changed, 36 insertions(+), 7 deletions(-)
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 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); 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 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
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 @@ HRESULT editor_exec_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VAR 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 @@ const cmdtable_t editmode_cmds[] = { {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 @@ static HRESULT exec_htmleditmode(HTMLDocument *This, DWORD cmdexecopt, VARIANT * 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 @@ static const cmdtable_t base_cmds[] = { {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},