From 41a3b734f9468b4c3a3516eca9b8bc3d50db1d0b Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Wed, 12 Sep 2007 10:42:01 +0100 Subject: [PATCH] mshtml: Implement PersistStreamInit_IsDirty when in edit mode. --- dlls/mshtml/editor.c | 12 ++++++++++++ dlls/mshtml/mshtml_private.h | 1 + dlls/mshtml/persist.c | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index 43c8b38bc26..6f202e03b12 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -1163,3 +1163,15 @@ void init_editor(HTMLDocument *This) set_ns_fontname(This->nscontainer, "Times New Roman"); } + +HRESULT editor_is_dirty(HTMLDocument *This) +{ + PRBool modified; + + if(!This->nscontainer || !This->nscontainer->editor) + return S_FALSE; + + nsIEditor_GetDocumentModified(This->nscontainer->editor, &modified); + + return modified ? S_OK : S_FALSE; +} diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 17197141520..79935a88d65 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -456,6 +456,7 @@ HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*); HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*); HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*); void handle_edit_load(HTMLDocument *This); +HRESULT editor_is_dirty(HTMLDocument*); extern DWORD mshtml_tls; diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 3b606d6cc53..9f74c91d05c 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -600,7 +600,7 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface) TRACE("(%p)\n", This); if(This->usermode == EDITMODE) - FIXME("Unimplemented in edit mode\n"); + return editor_is_dirty(This); return S_FALSE; }