From 0360340068d8572f695cd5c56518c31e75c7afe2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Sun, 12 Mar 2006 15:14:12 +0000 Subject: [PATCH] Line-up interfaces to use size_t for GetCount()s (and count related api). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mimetype.h | 2 +- src/mac/carbon/mimetmac.cpp | 17 ++++++++--------- src/msw/mimetype.cpp | 4 ++-- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/wx/mimetype.h b/include/wx/mimetype.h index bb7a1e6251..9018394a12 100644 --- a/include/wx/mimetype.h +++ b/include/wx/mimetype.h @@ -119,7 +119,7 @@ public: const wxString& GetDescription() const { return m_desc; } // get the array of all extensions const wxArrayString& GetExtensions() const { return m_exts; } - int GetExtensionsCount() const {return m_exts.GetCount(); } + size_t GetExtensionsCount() const {return m_exts.GetCount(); } // get the icon info const wxString& GetIconFile() const { return m_iconFile; } int GetIconIndex() const { return m_iconIndex; } diff --git a/src/mac/carbon/mimetmac.cpp b/src/mac/carbon/mimetmac.cpp index f1ce7743e5..e53d77111f 100644 --- a/src/mac/carbon/mimetmac.cpp +++ b/src/mac/carbon/mimetmac.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mac/mimetype.cpp +// Name: src/mac/carbon/mimetype.cpp // Purpose: Mac Carbon implementation for wx MIME-related classes // Author: Ryan Norton // Modified by: @@ -30,6 +30,8 @@ #pragma hdrstop #endif +#if wxUSE_MIMETYPE + #ifndef WX_PRECOMP #include "wx/string.h" @@ -38,9 +40,6 @@ #endif #endif - -#if wxUSE_MIMETYPE - #include "wx/log.h" #include "wx/file.h" #include "wx/intl.h" @@ -415,7 +414,7 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const m_lIndex, &entry); wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension); - sCurrentExtension = sCurrentExtension.Right(sCurrentExtension.Length()-1 ); + sCurrentExtension = sCurrentExtension.Right(sCurrentExtension.length()-1 ); //type, creator, ext, roles, outapp (FSRef), outappurl CFURLRef cfurlAppPath; @@ -547,7 +546,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) //entry has period in it wxString sCurrentExtension = wxMacMakeStringFromPascal( entry.extension ); - extensions.Add( sCurrentExtension.Right( sCurrentExtension.Length() - 1 ) ); + extensions.Add( sCurrentExtension.Right( sCurrentExtension.length() - 1 ) ); return true; } @@ -717,7 +716,7 @@ wxFileType* wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& e) if (status == noErr) { wxString sCurrentExtension = wxMacMakeStringFromPascal(entry.extension); - if ( sCurrentExtension.Right(sCurrentExtension.Length() - 1) == e ) // entry has period in it + if ( sCurrentExtension.Right(sCurrentExtension.length() - 1) == e ) // entry has period in it { wxFileType* pFileType = new wxFileType(); pFileType->m_impl->Init((wxMimeTypesManagerImpl*)this, pos); @@ -1592,7 +1591,7 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) //'*' for unrestricted if (ftInfo.GetExtensionsCount() != 0) { - for (size_t iExtension = 0; iExtension < (size_t)ftInfo.GetExtensionsCount(); ++iExtension) + for (size_t iExtension = 0; iExtension < ftInfo.GetExtensionsCount(); ++iExtension) { cfaExtensions.Add( wxCFString( asExtensions[iExtension] ) ); } @@ -1750,7 +1749,7 @@ wxFileType* wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) wxMacStringToPascal(ftInfo.GetDescription(), psDescription); Str255 psPostCreatorName; - wxMacStringToPascal(wxT(""), psPostCreatorName); + wxMacStringToPascal(wxEmptyString, psPostCreatorName); //add the entry to the database ICMapEntry entry; diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index 89a5f9e82e..0525d92b49 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/mimetype.cpp +// Name: src/msw/mimetype.cpp // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: @@ -509,7 +509,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) _T("Associate() needs extension") ); bool ok; - int iExtCount = 0 ; + size_t iExtCount = 0; wxString filetype; wxString extWithDot; -- 2.45.2