]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/filedlg.cpp
Dialog items inherit parent's font now
[wxWidgets.git] / src / msw / filedlg.cpp
index b302e60220cd1a9153b6f301bbccdf1c035aef9d..eaed27850c87d2a455da12e2dfb2b511f70aba2e 100644 (file)
@@ -106,8 +106,8 @@ wxString wxFileSelector(const char *title,
 
                 if( i-is-1 > 0 && is+1 < filter2.Len() )
                 {
-//                    if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) )
-                    if( filter2.Mid(is+1,i-is-1) == defaultExtension )
+                    if( filter2.Mid(is+1,i-is-1).Contains(defaultExtension) )
+//                    if( filter2.Mid(is+1,i-is-1) == defaultExtension )
                     {
                         filterFind = filterIndex;
                         break;
@@ -241,7 +241,11 @@ int wxFileDialog::ShowModal(void)
      */
     //=======================================================================
 
-    wxString theFilter = ( Strlen(m_wildCard) == 0 ) ? wxString("*.*") : m_wildCard;
+    wxString theFilter;
+    if ( Strlen(m_wildCard) == 0 )
+        theFilter = wxString("*.*");
+    else
+        theFilter = m_wildCard ;
     wxString filterBuffer;
 
     if ( !strchr( theFilter, '|' ) ) {    // only one filter ==> default text
@@ -251,10 +255,13 @@ int wxFileDialog::ShowModal(void)
     else {                                // more then one filter
         filterBuffer = theFilter;
 
-        for ( unsigned int i = 0; i < filterBuffer.Len(); i++ ) {
-            if ( filterBuffer.GetChar(i) == '|' ) {
-                filterBuffer[i] = '\0';
-            }
+    }
+
+    filterBuffer += "|";
+    // Replace | with \0
+    for ( unsigned int i = 0; i < filterBuffer.Len(); i++ ) {
+        if ( filterBuffer.GetChar(i) == '|' ) {
+            filterBuffer[i] = '\0';
         }
     }