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) ...@@ -182,8 +182,7 @@ BOOL DoCloseFile(void)
/* prompt user to save changes */ /* prompt user to save changes */
nResult = AlertFileNotSaved(Globals.szFileName); nResult = AlertFileNotSaved(Globals.szFileName);
switch (nResult) { switch (nResult) {
case IDYES: DIALOG_FileSave(); case IDYES: return DIALOG_FileSave();
break;
case IDNO: break; case IDNO: break;
...@@ -316,15 +315,16 @@ VOID DIALOG_FileOpen(VOID) ...@@ -316,15 +315,16 @@ VOID DIALOG_FileOpen(VOID)
} }
VOID DIALOG_FileSave(VOID) BOOL DIALOG_FileSave(VOID)
{ {
if (Globals.szFileName[0] == '\0') if (Globals.szFileName[0] == '\0')
DIALOG_FileSaveAs(); return DIALOG_FileSaveAs();
else else
DoSaveFile(); DoSaveFile();
return TRUE;
} }
VOID DIALOG_FileSaveAs(VOID) BOOL DIALOG_FileSaveAs(VOID)
{ {
OPENFILENAME saveas; OPENFILENAME saveas;
WCHAR szPath[MAX_PATH]; WCHAR szPath[MAX_PATH];
...@@ -352,7 +352,9 @@ VOID DIALOG_FileSaveAs(VOID) ...@@ -352,7 +352,9 @@ VOID DIALOG_FileSaveAs(VOID)
SetFileName(szPath); SetFileName(szPath);
UpdateWindowCaption(); UpdateWindowCaption();
DoSaveFile(); DoSaveFile();
return TRUE;
} }
return FALSE;
} }
typedef struct { typedef struct {
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
VOID DIALOG_FileNew(VOID); VOID DIALOG_FileNew(VOID);
VOID DIALOG_FileOpen(VOID); VOID DIALOG_FileOpen(VOID);
VOID DIALOG_FileSave(VOID); BOOL DIALOG_FileSave(VOID);
VOID DIALOG_FileSaveAs(VOID); BOOL DIALOG_FileSaveAs(VOID);
VOID DIALOG_FilePrint(VOID); VOID DIALOG_FilePrint(VOID);
VOID DIALOG_FilePageSetup(VOID); VOID DIALOG_FilePageSetup(VOID);
VOID DIALOG_FilePrinterSetup(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