fix for single item wildcards with no explanatory name item

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16652 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-08-21 16:06:44 +00:00
parent 4ccc303a24
commit d1aba6dbbd
2 changed files with 20 additions and 12 deletions

View File

@@ -144,12 +144,16 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
current += filter2.GetChar(i) ;
}
}
// if ( filterIndex > 0 )
{
wxASSERT_MSG( !isName , "incorrect format of format string" ) ;
myData->extensions[filterIndex] = current.MakeUpper() ;
++filterIndex ;
}
// we allow for compatibility reason to have a single filter expression (like *.*) without
// an explanatory text, in that case the first part is name and extension at the same time
wxASSERT_MSG( filterIndex == 0 || !isName , "incorrect format of format string" ) ;
if ( current.IsEmpty() )
myData->extensions[filterIndex] = myData->name[filterIndex] ;
else
myData->extensions[filterIndex] = current.MakeUpper() ;
++filterIndex ;
myData->numfilters = filterIndex ;
for ( int i = 0 ; i < myData->numfilters ; i++ )

View File

@@ -144,12 +144,16 @@ void MakeUserDataRec(OpenUserDataRec *myData , const wxString& filter )
current += filter2.GetChar(i) ;
}
}
// if ( filterIndex > 0 )
{
wxASSERT_MSG( !isName , "incorrect format of format string" ) ;
myData->extensions[filterIndex] = current.MakeUpper() ;
++filterIndex ;
}
// we allow for compatibility reason to have a single filter expression (like *.*) without
// an explanatory text, in that case the first part is name and extension at the same time
wxASSERT_MSG( filterIndex == 0 || !isName , "incorrect format of format string" ) ;
if ( current.IsEmpty() )
myData->extensions[filterIndex] = myData->name[filterIndex] ;
else
myData->extensions[filterIndex] = current.MakeUpper() ;
++filterIndex ;
myData->numfilters = filterIndex ;
for ( int i = 0 ; i < myData->numfilters ; i++ )