[pkg-wine-party] [SCM] Debian Wine packaging branch, wheezy, updated. wine-1.4-7-302-gb61b690
Alexandre Julliard
julliard at winehq.org
Sun Jun 17 20:03:13 UTC 2012
The following commit has been merged in the wheezy branch:
commit ffc2e45c589e417bbbba6d424c1f3764329e9f96
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Apr 11 13:50:57 2012 +0100
wordpad: Don't quit if the user cancels the save-as dialog when being prompted to save changes.
(cherry picked from commit 965388465d7d358a4cf08d5470485ac370c2f840)
diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c
index f47aedd..24d956a 100644
--- a/programs/wordpad/wordpad.c
+++ b/programs/wordpad/wordpad.c
@@ -835,7 +835,7 @@ static void ShowWriteError(DWORD Code)
MessageBoxW(hMainWnd, Message, wszAppTitle, MB_ICONEXCLAMATION | MB_OK);
}
-static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
+static BOOL DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
{
HANDLE hFile;
EDITSTREAM stream;
@@ -847,7 +847,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
if(hFile == INVALID_HANDLE_VALUE)
{
ShowWriteError(GetLastError());
- return;
+ return FALSE;
}
if(format == (SF_TEXT | SF_UNICODE))
@@ -859,7 +859,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
if(writeOut != sizeof(unicode))
{
CloseHandle(hFile);
- return;
+ return FALSE;
}
}
@@ -879,16 +879,18 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
gt.codepage = 1200;
if(SendMessageW(hEditorWnd, EM_GETTEXTLENGTHEX, (WPARAM)>, 0))
- return;
+ return FALSE;
}
lstrcpyW(wszFileName, wszSaveFileName);
set_caption(wszFileName);
SendMessageW(hEditorWnd, EM_SETMODIFY, FALSE, 0);
set_fileformat(format);
+
+ return TRUE;
}
-static void DialogSaveFile(void)
+static BOOL DialogSaveFile(void)
{
OPENFILENAMEW sfn;
@@ -912,19 +914,11 @@ static void DialogSaveFile(void)
{
if(MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_SAVE_LOSEFORMATTING),
wszAppTitle, MB_YESNO | MB_ICONEXCLAMATION) != IDYES)
- {
continue;
- } else
- {
- DoSaveFile(sfn.lpstrFile, fileformat_flags(sfn.nFilterIndex-1));
- break;
- }
- } else
- {
- DoSaveFile(sfn.lpstrFile, fileformat_flags(sfn.nFilterIndex-1));
- break;
}
+ return DoSaveFile(sfn.lpstrFile, fileformat_flags(sfn.nFilterIndex-1));
}
+ return FALSE;
}
static BOOL prompt_save_changes(void)
@@ -971,10 +965,8 @@ static BOOL prompt_save_changes(void)
case IDYES:
if(wszFileName[0])
- DoSaveFile(wszFileName, fileFormat);
- else
- DialogSaveFile();
- return TRUE;
+ return DoSaveFile(wszFileName, fileFormat);
+ return DialogSaveFile();
default:
return FALSE;
--
Debian Wine packaging
More information about the pkg-wine-party
mailing list