Set default extension in Windows file dialog

On Windows when you open the save dialog and switch the filter, the
extension is supposed to change accordingly. It didn't happen with the
existing code, since the existing code didn't set the default extension
(should be set to the first filter).

This resolves #2915.
This commit is contained in:
Eran Tiktin 2015-09-28 02:12:47 +03:00
parent fd9eadd1fa
commit 6dcc752f67

View file

@ -79,6 +79,9 @@ class FileDialog {
if (!title.empty())
GetPtr()->SetTitle(base::UTF8ToUTF16(title).c_str());
if (!filterspec.empty())
GetPtr()->SetDefaultExtension(filterspec.front().pszSpec);
SetDefaultFolder(default_path);
}