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

This commit is contained in:
Dmitry Timoshkov 2007-08-31 16:02:01 +09:00 committed by Alexandre Julliard
parent ee747f3d70
commit 4ea5fce083

View file

@ -217,7 +217,7 @@ void DoOpenFile(LPCWSTR szFileName)
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if(hFile == INVALID_HANDLE_VALUE) if(hFile == INVALID_HANDLE_VALUE)
{ {
ShowLastError(); AlertFileNotFound(szFileName);
return; return;
} }
@ -318,12 +318,8 @@ VOID DIALOG_FileOpen(VOID)
openfilename.lpstrDefExt = szDefaultExt; openfilename.lpstrDefExt = szDefaultExt;
if (GetOpenFileName(&openfilename)) { if (GetOpenFileName(&openfilename))
if (FileExists(openfilename.lpstrFile)) DoOpenFile(openfilename.lpstrFile);
DoOpenFile(openfilename.lpstrFile);
else
AlertFileNotFound(openfilename.lpstrFile);
}
} }