1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-18 16:41:14 +02:00

Fix for bug #983

Now we know why the "automatically add extension" stuff was
commented on in the FileDialog at least.  :-)
This commit is contained in:
Leland Lucius
2015-05-29 13:02:17 -05:00
parent 5c67bc38b3
commit e5f6a44656
6 changed files with 40 additions and 29 deletions

View File

@@ -328,18 +328,21 @@ wxString FileDialog::GetPath() const
if (!path.HasExt())
{
int filterIndex = GetFilterIndex();
if (filterIndex != -1)
{
wxStringTokenizer tokenizer(m_patterns[filterIndex], wxT(";"));
if (tokenizer.HasMoreTokens())
if (!(m_dialogStyle & FD_NO_ADD_EXTENSION))
{
int filterIndex = GetFilterIndex();
if (filterIndex != -1)
{
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
if (extension.Right(2) == wxT("*"))
wxStringTokenizer tokenizer(m_patterns[filterIndex], wxT(";"));
if (tokenizer.HasMoreTokens())
{
extension = wxEmptyString;
wxString extension = tokenizer.GetNextToken().AfterFirst(wxT('.'));
if (extension.Right(2) == wxT("*"))
{
extension = wxEmptyString;
}
path.SetExt(extension);
}
path.SetExt(extension);
}
}
}