Commit 32b6a1a0 authored by Hirofumi Katayama's avatar Hirofumi Katayama Committed by Alexandre Julliard

notepad: Cancel closing window by cancelling "Save As" dialog box.

parent cd999b20
......@@ -182,8 +182,7 @@ BOOL DoCloseFile(void)
/* prompt user to save changes */
nResult = AlertFileNotSaved(Globals.szFileName);
switch (nResult) {
case IDYES: DIALOG_FileSave();
break;
case IDYES: return DIALOG_FileSave();
case IDNO: break;
......@@ -316,15 +315,16 @@ VOID DIALOG_FileOpen(VOID)
}
VOID DIALOG_FileSave(VOID)
BOOL DIALOG_FileSave(VOID)
{
if (Globals.szFileName[0] == '\0')
DIALOG_FileSaveAs();
return DIALOG_FileSaveAs();
else
DoSaveFile();
return TRUE;
}
VOID DIALOG_FileSaveAs(VOID)
BOOL DIALOG_FileSaveAs(VOID)
{
OPENFILENAME saveas;
WCHAR szPath[MAX_PATH];
......@@ -352,7 +352,9 @@ VOID DIALOG_FileSaveAs(VOID)
SetFileName(szPath);
UpdateWindowCaption();
DoSaveFile();
return TRUE;
}
return FALSE;
}
typedef struct {
......
......@@ -20,8 +20,8 @@
VOID DIALOG_FileNew(VOID);
VOID DIALOG_FileOpen(VOID);
VOID DIALOG_FileSave(VOID);
VOID DIALOG_FileSaveAs(VOID);
BOOL DIALOG_FileSave(VOID);
BOOL DIALOG_FileSaveAs(VOID);
VOID DIALOG_FilePrint(VOID);
VOID DIALOG_FilePageSetup(VOID);
VOID DIALOG_FilePrinterSetup(VOID);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment