]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/mimecmn.cpp
Rework the wxCusor ctor taking wx stock number to provide as many cursors as
[wxWidgets.git] / src / common / mimecmn.cpp
index 21eb8f5c0f254264d83416dc1c92a31afaaa7057..bbd1d1e86d2e9605af180dde24b00fe28beb7311 100644 (file)
@@ -636,7 +636,18 @@ wxFileType *
 wxMimeTypesManager::GetFileTypeFromExtension(const wxString& ext)
 {
     EnsureImpl();
-    wxFileType *ft = m_impl->GetFileTypeFromExtension(ext);
+
+    wxString::const_iterator i = ext.begin();
+    const wxString::const_iterator end = ext.end();
+    wxString extWithoutDot;
+    if ( i != end && *i == '.' )
+        extWithoutDot.assign(++i, ext.end());
+    else
+        extWithoutDot = ext;
+
+    wxCHECK_MSG( !ext.empty(), NULL, _T("extension can't be empty") );
+
+    wxFileType *ft = m_impl->GetFileTypeFromExtension(extWithoutDot);
 
     if ( !ft ) {
         // check the fallbacks