X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11d395f9d74b35a0bcaf222de1d8f093b9dba2c4..7848088476db284a94f19eeb24411b45d676ac46:/src/msw/mimetype.cpp diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index a7242a7de4..bd6edf88f5 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -22,9 +22,6 @@ #if wxUSE_MIMETYPE -// Doesn't compile in WIN16 mode -#ifndef __WIN16__ - #ifndef WX_PRECOMP #include "wx/string.h" #if wxUSE_GUI @@ -514,7 +511,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) wxCHECK_MSG( !ftInfo.GetExtensions().IsEmpty(), NULL, _T("Associate() needs extension") ); - bool ok = FALSE ; + bool ok; int iExtCount = 0 ; wxString filetype; wxString extWithDot; @@ -551,7 +548,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) filetype = filetypeOrig; } - ok = key.SetValue(wxEmptyString, filetype); + key.SetValue(wxEmptyString, filetype); } } else @@ -560,11 +557,11 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if (!filetypeOrig.empty()) { filetype = filetypeOrig; - ok = key.SetValue(wxEmptyString, filetype); + key.SetValue(wxEmptyString, filetype); } else { - ok = key.QueryValue(wxEmptyString, filetype); + key.QueryValue(wxEmptyString, filetype); } } // now set a mimetypeif we have it, but ignore it if none @@ -585,7 +582,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( ok ) { // and provide a back link to the extension - ok = keyMIME.SetValue(_T("Extension"), extWithDot); + keyMIME.SetValue(_T("Extension"), extWithDot); } } } @@ -601,8 +598,8 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) extWithDot += ext; wxRegKey key(wxRegKey::HKCR, extWithDot); - if ( !key.Exists() ) ok = key.Create(); - ok = key.SetValue(wxEmptyString, filetype); + if ( !key.Exists() ) key.Create(); + key.SetValue(wxEmptyString, filetype); // now set any mimetypes we may have, but ignore it if none const wxString& mimetype = ftInfo.GetMimeType(); @@ -622,7 +619,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( ok ) { // and provide a back link to the extension - ok = keyMIME.SetValue(_T("Extension"), extWithDot); + keyMIME.SetValue(_T("Extension"), extWithDot); } } } @@ -633,10 +630,9 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) // create the filetype key itself (it will be empty for now, but // SetCommand(), SetDefaultIcon() &c will use it later) wxRegKey keyFT(wxRegKey::HKCR, filetype); - ok = keyFT.Create(); + keyFT.Create(); - wxFileType *ft = NULL; - ft = CreateFileType(filetype, extWithDot); + wxFileType *ft = CreateFileType(filetype, extWithDot); if (ft) { @@ -823,7 +819,4 @@ bool wxFileTypeImpl::RemoveDescription() return !rkey.Exists() || rkey.DeleteSelf(); } -#endif - // __WIN16__ - #endif // wxUSE_MIMETYPE