Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
96538846
Commit
96538846
authored
Apr 11, 2012
by
Huw Davies
Committed by
Alexandre Julliard
Apr 11, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wordpad: Don't quit if the user cancels the save-as dialog when being prompted to save changes.
parent
43cffa08
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
wordpad.c
programs/wordpad/wordpad.c
+11
-19
No files found.
programs/wordpad/wordpad.c
View file @
96538846
...
@@ -835,7 +835,7 @@ static void ShowWriteError(DWORD Code)
...
@@ -835,7 +835,7 @@ static void ShowWriteError(DWORD Code)
MessageBoxW
(
hMainWnd
,
Message
,
wszAppTitle
,
MB_ICONEXCLAMATION
|
MB_OK
);
MessageBoxW
(
hMainWnd
,
Message
,
wszAppTitle
,
MB_ICONEXCLAMATION
|
MB_OK
);
}
}
static
void
DoSaveFile
(
LPCWSTR
wszSaveFileName
,
WPARAM
format
)
static
BOOL
DoSaveFile
(
LPCWSTR
wszSaveFileName
,
WPARAM
format
)
{
{
HANDLE
hFile
;
HANDLE
hFile
;
EDITSTREAM
stream
;
EDITSTREAM
stream
;
...
@@ -847,7 +847,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
...
@@ -847,7 +847,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
if
(
hFile
==
INVALID_HANDLE_VALUE
)
if
(
hFile
==
INVALID_HANDLE_VALUE
)
{
{
ShowWriteError
(
GetLastError
());
ShowWriteError
(
GetLastError
());
return
;
return
FALSE
;
}
}
if
(
format
==
(
SF_TEXT
|
SF_UNICODE
))
if
(
format
==
(
SF_TEXT
|
SF_UNICODE
))
...
@@ -859,7 +859,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
...
@@ -859,7 +859,7 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
if
(
writeOut
!=
sizeof
(
unicode
))
if
(
writeOut
!=
sizeof
(
unicode
))
{
{
CloseHandle
(
hFile
);
CloseHandle
(
hFile
);
return
;
return
FALSE
;
}
}
}
}
...
@@ -879,16 +879,18 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
...
@@ -879,16 +879,18 @@ static void DoSaveFile(LPCWSTR wszSaveFileName, WPARAM format)
gt
.
codepage
=
1200
;
gt
.
codepage
=
1200
;
if
(
SendMessageW
(
hEditorWnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gt
,
0
))
if
(
SendMessageW
(
hEditorWnd
,
EM_GETTEXTLENGTHEX
,
(
WPARAM
)
&
gt
,
0
))
return
;
return
FALSE
;
}
}
lstrcpyW
(
wszFileName
,
wszSaveFileName
);
lstrcpyW
(
wszFileName
,
wszSaveFileName
);
set_caption
(
wszFileName
);
set_caption
(
wszFileName
);
SendMessageW
(
hEditorWnd
,
EM_SETMODIFY
,
FALSE
,
0
);
SendMessageW
(
hEditorWnd
,
EM_SETMODIFY
,
FALSE
,
0
);
set_fileformat
(
format
);
set_fileformat
(
format
);
return
TRUE
;
}
}
static
void
DialogSaveFile
(
void
)
static
BOOL
DialogSaveFile
(
void
)
{
{
OPENFILENAMEW
sfn
;
OPENFILENAMEW
sfn
;
...
@@ -912,19 +914,11 @@ static void DialogSaveFile(void)
...
@@ -912,19 +914,11 @@ static void DialogSaveFile(void)
{
{
if
(
MessageBoxWithResStringW
(
hMainWnd
,
MAKEINTRESOURCEW
(
STRING_SAVE_LOSEFORMATTING
),
if
(
MessageBoxWithResStringW
(
hMainWnd
,
MAKEINTRESOURCEW
(
STRING_SAVE_LOSEFORMATTING
),
wszAppTitle
,
MB_YESNO
|
MB_ICONEXCLAMATION
)
!=
IDYES
)
wszAppTitle
,
MB_YESNO
|
MB_ICONEXCLAMATION
)
!=
IDYES
)
{
continue
;
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
)
static
BOOL
prompt_save_changes
(
void
)
...
@@ -971,10 +965,8 @@ static BOOL prompt_save_changes(void)
...
@@ -971,10 +965,8 @@ static BOOL prompt_save_changes(void)
case
IDYES
:
case
IDYES
:
if
(
wszFileName
[
0
])
if
(
wszFileName
[
0
])
DoSaveFile
(
wszFileName
,
fileFormat
);
return
DoSaveFile
(
wszFileName
,
fileFormat
);
else
return
DialogSaveFile
();
DialogSaveFile
();
return
TRUE
;
default:
default:
return
FALSE
;
return
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment