X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b3b7f55560a6e43bde4fe0692d08ab7d90c6cf8..b733a0174af157ce8c8869e3db17a353d9425483:/src/common/intl.cpp diff --git a/src/common/intl.cpp b/src/common/intl.cpp index b718973fea..9ebb5edcd5 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1934,18 +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 - CFTypeRef cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode); - wxMacCFStringHolder str(CFStringCreateCopy(NULL, static_cast(cfstr))); + wxCFStringRef str(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleLanguageCode))); langFull = str.AsString()+"_"; - - cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode); - str.Assign(CFStringCreateCopy(NULL, static_cast(cfstr))); + str.reset(wxCFRetain((CFStringRef)CFLocaleGetValue(userLocaleRef, kCFLocaleCountryCode))); langFull += str.AsString(); #else if (!wxGetEnv(wxT("LC_ALL"), &langFull) && @@ -2652,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(); }