- if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) ) // we have a directory
- break ;
-
- if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) ) // its a file but we don't want it
- continue ;
-
- if ( ( m_CPB.hFileInfo.ioFlFndrInfo.fdFlags & kIsInvisible ) && !(m_flags & wxDIR_HIDDEN) ) // its hidden but we don't want it
- continue ;
-
- wxString file( m_name ) ;
- if ( m_filespec.IsEmpty() || m_filespec == "*.*" || m_filespec == "*" )
- {
- }
- else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
- {
- if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
- {
- continue ;
- }
- }
- else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
- {
- if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
- {
- continue ;
- }
- }
- else if ( file.Upper() != m_filespec.Upper() )
- {
- continue ;
- }
-
- break ;
- }
- if ( err != noErr )
- {
- return FALSE ;
- }
-
- *filename = (char*) m_name ;
+ // we have a directory
+ if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (m_flags & wxDIR_DIRS) )
+ break ;
+
+ // its a file but we don't want it
+ if ( ( m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(m_flags & wxDIR_FILES ) )
+ continue ;
+
+ wxString file( m_name ) ;
+ if ( m_filespec.IsEmpty() || m_filespec == "*.*" || m_filespec == "*" )
+ {
+ }
+ else if ( m_filespec.Length() > 1 && m_filespec.Left(1) =="*" )
+ {
+ if ( file.Right( m_filespec.Length() - 1 ).Upper() != m_filespec.Mid(1).Upper() )
+ {
+ continue ;
+ }
+ }
+ else if ( m_filespec.Length() > 1 && m_filespec.Right(1) == "*" )
+ {
+ if ( file.Left( m_filespec.Length() - 1 ).Upper() != m_filespec.Left( m_filespec.Length() - 1 ).Upper() )
+ {
+ continue ;
+ }
+ }
+ else if ( file.Upper() != m_filespec.Upper() )
+ {
+ continue ;
+ }
+
+ break ;
+ }
+ if ( err != noErr )
+ {
+ return FALSE ;
+ }
+
+ *filename = (char*) m_name ;