From 80539f0490f5a5858568d3ed79b021594c23c521 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 8 Dec 2007 17:38:38 +0000 Subject: [PATCH] unifying CFTypes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filefn.cpp | 6 +++--- src/common/intl.cpp | 7 +++---- src/common/wxcrt.cpp | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index ff3dc70050..2d97a8a741 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -900,13 +900,13 @@ wxString wxMacFSRefToPath( const FSRef *fsRef , CFStringRef additionalPathCompon CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfString); CFRelease( cfString ); CFStringNormalize(cfMutableString,kCFStringNormalizationFormC); - return wxMacCFStringHolder(cfMutableString).AsString(); + return wxCFStringRef(cfMutableString).AsString(); } OSStatus wxMacPathToFSRef( const wxString&path , FSRef *fsRef ) { OSStatus err = noErr ; - CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxMacCFStringHolder(path)); + CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, wxCFStringRef(path)); CFStringNormalize(cfMutableString,kCFStringNormalizationFormD); CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, cfMutableString , kDefaultPathStyle, false); CFRelease( cfMutableString ); @@ -931,7 +931,7 @@ wxString wxMacHFSUniStrToString( ConstHFSUniStr255Param uniname ) CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(NULL, 0, cfname); CFRelease( cfname ); CFStringNormalize(cfMutableString,kCFStringNormalizationFormC); - return wxMacCFStringHolder(cfMutableString).AsString() ; + return wxCFStringRef(cfMutableString).AsString() ; } #ifndef __LP64__ diff --git a/src/common/intl.cpp b/src/common/intl.cpp index c03a9824b3..9ebb5edcd5 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1934,15 +1934,14 @@ void wxLocale::AddCatalogLookupPathPrefix(const wxString& prefix) // first get the string identifying the language from the environment wxString langFull; #ifdef __WXMAC__ - // as at the C-runtime level many OS X versions only have a "C" locale, therefore we use the CFLocale (ICU based) wxCFRef userLocaleRef(CFLocaleCopyCurrent()); // because the locale identifier (kCFLocaleIdentifier) is formatted a little bit differently, eg // az_Cyrl_AZ@calendar=buddhist;currency=JPY we just recreate the base info as expected by wx here - wxMacCFStringHolder str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode))); + wxCFStringRef str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode))); langFull = str.AsString()+"_"; - str.Assign(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode))); + str.reset(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode))); langFull += str.AsString(); #else if (!wxGetEnv(wxT("LC_ALL"), &langFull) && @@ -2649,7 +2648,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) wxFAIL_MSG( "Unknown locale info" ); } - wxMacCFStringHolder + wxCFStringRef str(CFStringCreateCopy(NULL, static_cast(cfstr))); return str.AsString(); } diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index 55339ef61d..197fe9597d 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -174,9 +174,9 @@ char* wxSetlocale(int category, const char *locale) { // we have to emulate the behaviour under OS X wxCFRef userLocaleRef(CFLocaleCopyCurrent()); - wxMacCFStringHolder str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode))); + wxCFStringRef str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode))); wxString langFull = str.AsString()+"_"; - str.Assign(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode))); + str.reset(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode))); langFull += str.AsString(); rv = setlocale(category, langFull.c_str()); } -- 2.45.2