strip the leading dot from extension if present in GetFileTypeFromExtension()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user