X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d2976ad6b56ff1650e15f2b949c10ec92385309..c13cace12594b37706e9520a6fbd602c949f8127:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index e78a77cac0..4ca0315ec2 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -117,7 +117,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const } } -#if wxUSE_DDE +#if wxUSE_IPC // look whether we must issue some DDE requests to the application // (and not just launch it) strKey += _T("\\DDEExec"); @@ -141,7 +141,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const << _T('#') << ddeCommand; } else -#endif // wxUSE_DDE +#endif // wxUSE_IPC if ( !foundFilename ) { // we didn't find any '%1' - the application doesn't know which // file to open (note that we only do it if there is no DDEExec @@ -227,27 +227,23 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const // suppress possible error messages wxLogNull nolog; wxRegKey key(wxRegKey::HKCR, wxT(".") + m_ext); - if ( key.Open() && key.QueryValue(wxT("Content Type"), *mimeType) ) { - return TRUE; - } - else { - return FALSE; - } + + return key.Open() && key.QueryValue(wxT("Content Type"), *mimeType); } bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const { wxString s; - - if (GetMimeType(&s)) + + if ( !GetMimeType(&s) ) { - mimeTypes.Clear(); - mimeTypes.Add(s); - return TRUE; - } - else return FALSE; + } + + mimeTypes.Clear(); + mimeTypes.Add(s); + return TRUE; } @@ -378,18 +374,16 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) } } - if ( knownExtension ) - { - wxFileType *fileType = new wxFileType; - fileType->m_impl->Init(wxEmptyString, ext); - - return fileType; - } - else + if ( !knownExtension ) { // unknown extension return NULL; } + + wxFileType *fileType = new wxFileType; + fileType->m_impl->Init(wxEmptyString, ext); + + return fileType; } // MIME type -> extension -> file type