Henry Kroll III : notepad: Don't prompt to save empty Untitled file.

Alexandre Julliard julliard at winehq.org
Mon Mar 15 12:19:29 CDT 2010


Module: wine
Branch: master
Commit: d3369086ed34bc8147ceed6a2e2d3a4e0ec7d775
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d3369086ed34bc8147ceed6a2e2d3a4e0ec7d775

Author: Henry Kroll III <henry at comptune.com>
Date:   Sat Mar  6 21:05:21 2010 -0800

notepad: Don't prompt to save empty Untitled file.

---

 programs/notepad/dialog.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 45d0c75..e19e4d6 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -297,7 +297,9 @@ BOOL DoCloseFile(void)
     int nResult;
     static const WCHAR empty_strW[] = { 0 };
 
-    if (SendMessageW(Globals.hEdit, EM_GETMODIFY, 0, 0))
+    nResult=GetWindowTextLengthW(Globals.hEdit);
+    if (SendMessageW(Globals.hEdit, EM_GETMODIFY, 0, 0) &&
+        (nResult || Globals.szFileName[0]))
     {
         /* prompt user to save changes */
         nResult = AlertFileNotSaved(Globals.szFileName);




More information about the wine-cvs mailing list