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
0d96d26f
Commit
0d96d26f
authored
May 24, 2011
by
David Hedberg
Committed by
Alexandre Julliard
May 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comdlg32: Improve handling of file extension changes in the Item Dialog.
parent
d441d3b8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
itemdlg.c
dlls/comdlg32/itemdlg.c
+23
-0
No files found.
dlls/comdlg32/itemdlg.c
View file @
0d96d26f
...
...
@@ -872,16 +872,39 @@ static LRESULT on_command_filetype(FileDialogImpl *This, WPARAM wparam, LPARAM l
{
IShellView
*
psv
;
HRESULT
hr
;
LPWSTR
filename
;
UINT
prev_index
=
This
->
filetypeindex
;
This
->
filetypeindex
=
SendMessageW
((
HWND
)
lparam
,
CB_GETCURSEL
,
0
,
0
);
TRACE
(
"File type selection changed to %d.
\n
"
,
This
->
filetypeindex
);
if
(
prev_index
==
This
->
filetypeindex
)
return
FALSE
;
hr
=
IExplorerBrowser_GetCurrentView
(
This
->
peb
,
&
IID_IShellView
,
(
void
**
)
&
psv
);
if
(
SUCCEEDED
(
hr
))
{
IShellView_Refresh
(
psv
);
IShellView_Release
(
psv
);
}
if
(
This
->
dlg_type
==
ITEMDLG_TYPE_SAVE
&&
get_file_name
(
This
,
&
filename
))
{
WCHAR
buf
[
MAX_PATH
],
extbuf
[
MAX_PATH
],
*
ext
;
ext
=
get_first_ext_from_spec
(
extbuf
,
This
->
filterspecs
[
This
->
filetypeindex
].
pszSpec
);
if
(
ext
)
{
lstrcpyW
(
buf
,
filename
);
if
(
PathMatchSpecW
(
buf
,
This
->
filterspecs
[
prev_index
].
pszSpec
))
PathRemoveExtensionW
(
buf
);
lstrcatW
(
buf
,
ext
);
set_file_name
(
This
,
buf
);
}
CoTaskMemFree
(
filename
);
}
}
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