Jacek Caban : mshtml: Move IsDirty implementation to GeckoBrowser.

Alexandre Julliard julliard at winehq.org
Tue Mar 12 16:56:16 CDT 2019


Module: wine
Branch: master
Commit: 1ea4924e4669e8ab01c77c2bb91d0c083f5c81ef
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1ea4924e4669e8ab01c77c2bb91d0c083f5c81ef

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Tue Mar 12 16:11:10 2019 +0100

mshtml: Move IsDirty implementation to GeckoBrowser.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mshtml/editor.c         | 7 +++----
 dlls/mshtml/mshtml_private.h | 2 +-
 dlls/mshtml/persist.c        | 5 +----
 3 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c
index a7943af..5f59284 100644
--- a/dlls/mshtml/editor.c
+++ b/dlls/mshtml/editor.c
@@ -1223,15 +1223,14 @@ void init_editor(HTMLDocument *This)
     set_ns_fontname(This, "Times New Roman");
 }
 
-HRESULT editor_is_dirty(HTMLDocument *This)
+HRESULT browser_is_dirty(GeckoBrowser *browser)
 {
     cpp_bool modified;
 
-    if(!This->doc_obj->nscontainer || !This->doc_obj->nscontainer->editor)
+    if(browser->usermode != EDITMODE || !browser->editor)
         return S_FALSE;
 
-    nsIEditor_GetDocumentModified(This->doc_obj->nscontainer->editor, &modified);
-
+    nsIEditor_GetDocumentModified(browser->editor, &modified);
     return modified ? S_OK : S_FALSE;
 }
 
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h
index 3577607..9933a41 100644
--- a/dlls/mshtml/mshtml_private.h
+++ b/dlls/mshtml/mshtml_private.h
@@ -1141,7 +1141,7 @@ HRESULT editor_exec_copy(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT editor_exec_cut(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
 HRESULT editor_exec_paste(HTMLDocument*,DWORD,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
 void handle_edit_load(HTMLDocument*) DECLSPEC_HIDDEN;
-HRESULT editor_is_dirty(HTMLDocument*) DECLSPEC_HIDDEN;
+HRESULT browser_is_dirty(GeckoBrowser*) DECLSPEC_HIDDEN;
 void set_dirty(GeckoBrowser*,VARIANT_BOOL) DECLSPEC_HIDDEN;
 
 extern DWORD mshtml_tls DECLSPEC_HIDDEN;
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c
index cd52ac9..a798650 100644
--- a/dlls/mshtml/persist.c
+++ b/dlls/mshtml/persist.c
@@ -884,10 +884,7 @@ static HRESULT WINAPI PersistStreamInit_IsDirty(IPersistStreamInit *iface)
 
     TRACE("(%p)\n", This);
 
-    if(This->doc_obj->nscontainer->usermode == EDITMODE)
-        return editor_is_dirty(This);
-
-    return S_FALSE;
+    return browser_is_dirty(This->doc_obj->nscontainer);
 }
 
 static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, IStream *pStm)




More information about the wine-cvs mailing list