Dmitry Timoshkov : notepad: We pass OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST to GetOpenFileName, so there is no point in testing file existence.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 31 07:22:19 CDT 2007


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

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Fri Aug 31 16:02:01 2007 +0900

notepad: We pass OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST to GetOpenFileName, so there is no point in testing file existence.

---

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

diff --git a/programs/notepad/dialog.c b/programs/notepad/dialog.c
index 0a62c5e..c21c2d7 100644
--- a/programs/notepad/dialog.c
+++ b/programs/notepad/dialog.c
@@ -217,7 +217,7 @@ void DoOpenFile(LPCWSTR szFileName)
 	OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
     if(hFile == INVALID_HANDLE_VALUE)
     {
-	ShowLastError();
+	AlertFileNotFound(szFileName);
 	return;
     }
 
@@ -318,12 +318,8 @@ VOID DIALOG_FileOpen(VOID)
     openfilename.lpstrDefExt       = szDefaultExt;
 
 
-    if (GetOpenFileName(&openfilename)) {
-        if (FileExists(openfilename.lpstrFile))
-            DoOpenFile(openfilename.lpstrFile);
-        else
-            AlertFileNotFound(openfilename.lpstrFile);
-    }
+    if (GetOpenFileName(&openfilename))
+        DoOpenFile(openfilename.lpstrFile);
 }
 
 




More information about the wine-cvs mailing list