]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
Fix up NSSlider code to not use class posing and instantiate the proper type (now...
[wxWidgets.git] / src / unix / mimetype.cpp
index 20b96b5c21ba32a35a6ecf1c7d4d668ae6677a41..00d3b578472c67ed86d4f7fcf65fe6af8eaa2a74 100644 (file)
@@ -156,9 +156,6 @@ protected:
     }
 };
 
-// in case we're compiling in non-GUI mode
-class WXDLLEXPORT wxIcon;
-
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -1367,14 +1364,15 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs,
 
 bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
 {
-    wxString strExtensions = m_manager->GetExtension(m_index[0]);
+    const wxString strExtensions = m_manager->GetExtension(m_index[0]);
     extensions.Empty();
 
     // one extension in the space or comma-delimited list
     wxString strExt;
-    for ( const wxChar *p = strExtensions; /* nothing */; p++ )
+    wxString::const_iterator end = strExtensions.end();
+    for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p )
     {
-        if ( *p == wxT(' ') || *p == wxT(',') || *p == wxT('\0') )
+        if ( p == end || *p == wxT(' ') || *p == wxT(',') )
         {
             if ( !strExt.empty() )
             {
@@ -1384,7 +1382,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
             //else: repeated spaces
             // (shouldn't happen, but it's not that important if it does happen)
 
-            if ( *p == wxT('\0') )
+            if ( p == end )
                 break;
         }
         else if ( *p == wxT('.') )
@@ -2488,8 +2486,7 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data,
     }
 
     // is this something of the form foo=bar?
-    const wxChar *pEq = wxStrchr(curField, wxT('='));
-    if ( pEq != NULL )
+    if ( curField.find('=') != wxString::npos )
     {
         // split "LHS = RHS" in 2
         wxString lhs = curField.BeforeFirst(wxT('=')),
@@ -2613,8 +2610,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
             Field_Type,
             Field_OpenCmd,
             Field_Other
-        }
-        currentToken = Field_Type;
+        } currentToken = Field_Type;
 
         // the flags and field values on the current line
         MailcapLineData data;