X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b00bb1626a28272e58728633f431c0c2996cd2d..599a97e9ab9d9c1fca761d501ef101595e0ae486:/src/generic/filedlgg.cpp

diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp
index 78ceba169a..8b13841962 100644
--- a/src/generic/filedlgg.cpp
+++ b/src/generic/filedlgg.cpp
@@ -901,6 +901,12 @@ void wxFileDialog::SetPath( const wxString& path )
 void wxFileDialog::GetPaths( wxArrayString& paths ) const
 {
     paths.Empty();
+    if (m_list->GetSelectedItemCount() == 0)
+    {
+        paths.Add( GetPath() );
+        return;
+    }
+    
     paths.Alloc( m_list->GetSelectedItemCount() );
 
     wxString dir;
@@ -922,6 +928,11 @@ void wxFileDialog::GetPaths( wxArrayString& paths ) const
 void wxFileDialog::GetFilenames(wxArrayString& files) const
 {
     files.Empty();
+    if (m_list->GetSelectedItemCount() == 0)
+    {
+        files.Add( GetFilename() );
+        return;
+    }
     files.Alloc( m_list->GetSelectedItemCount() );
 
     wxListItem item;