X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e5722ef11d55ccd18f37cf02d97861c7480e9f84..e9863f4ea1ab957e59b421d36e6199c7b472476d:/src/common/intl.cpp diff --git a/src/common/intl.cpp b/src/common/intl.cpp index e61703c9c0..8d0f5f9891 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -72,10 +72,6 @@ #include "wx/hashset.h" #include "wx/filesys.h" -#if defined(__WXMAC__) - #include "wx/mac/private.h" // includes mac headers -#endif - #if defined(__DARWIN__) #include "wx/mac/corefoundation/cfref.h" #include @@ -240,7 +236,7 @@ wxPluralFormsScanner::wxPluralFormsScanner(const char* s) : m_s(s) bool wxPluralFormsScanner::nextToken() { wxPluralFormsToken::Type type = wxPluralFormsToken::T_ERROR; - while (isspace(*m_s)) + while (isspace((unsigned char) *m_s)) { ++m_s; } @@ -248,20 +244,20 @@ bool wxPluralFormsScanner::nextToken() { type = wxPluralFormsToken::T_EOF; } - else if (isdigit(*m_s)) + else if (isdigit((unsigned char) *m_s)) { wxPluralFormsToken::Number number = *m_s++ - '0'; - while (isdigit(*m_s)) + while (isdigit((unsigned char) *m_s)) { number = number * 10 + (*m_s++ - '0'); } m_token.setNumber(number); type = wxPluralFormsToken::T_NUMBER; } - else if (isalpha(*m_s)) + else if (isalpha((unsigned char) *m_s)) { const char* begin = m_s++; - while (isalnum(*m_s)) + while (isalnum((unsigned char) *m_s)) { ++m_s; } @@ -2237,7 +2233,7 @@ wxFontEncoding wxLocale::GetSystemEncoding() return wxFONTENCODING_CP950; } #elif defined(__WXMAC__) - TextEncoding encoding = 0 ; + CFStringEncoding encoding = 0 ; encoding = CFStringGetSystemEncoding() ; return wxMacGetFontEncFromSystemEnc( encoding ) ; #elif defined(__UNIX_LIKE__) && wxUSE_FONTMAP @@ -2677,23 +2673,24 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) wxCFRef userLocaleRef(userLocaleRefRaw); - CFTypeRef cfstr; + CFStringRef cfstr = 0; switch ( index ) { case wxLOCALE_THOUSANDS_SEP: - cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleGroupingSeparator); + cfstr = (CFStringRef) CFLocaleGetValue(userLocaleRef, kCFLocaleGroupingSeparator); break; case wxLOCALE_DECIMAL_POINT: - cfstr = CFLocaleGetValue(userLocaleRef, kCFLocaleDecimalSeparator); + cfstr = (CFStringRef) CFLocaleGetValue(userLocaleRef, kCFLocaleDecimalSeparator); break; default: wxFAIL_MSG( "Unknown locale info" ); + cfstr = CFSTR(""); + break; } - wxCFStringRef - str(CFStringCreateCopy(NULL, static_cast(cfstr))); + wxCFStringRef str(wxCFRetain(cfstr)); return str.AsString(); } @@ -2956,6 +2953,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxLocaleModule, wxModule) #ifndef LANG_RUSSIAN #define LANG_RUSSIAN (0) #endif +#ifndef LANG_SAMI +#define LANG_SAMI (0) +#endif #ifndef LANG_SANSKRIT #define LANG_SANSKRIT (0) #endif @@ -3447,6 +3447,7 @@ void wxLocale::InitLanguagesDB() LNG(wxLANGUAGE_ROMANIAN, "ro_RO", LANG_ROMANIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Romanian") LNG(wxLANGUAGE_RUSSIAN, "ru_RU", LANG_RUSSIAN , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Russian") LNG(wxLANGUAGE_RUSSIAN_UKRAINE, "ru_UA", 0 , 0 , wxLayout_LeftToRight, "Russian (Ukraine)") + LNG(wxLANGUAGE_SAMI, "se_NO", LANG_SAMI , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Northern Sami") LNG(wxLANGUAGE_SAMOAN, "sm" , 0 , 0 , wxLayout_LeftToRight, "Samoan") LNG(wxLANGUAGE_SANGHO, "sg" , 0 , 0 , wxLayout_LeftToRight, "Sangho") LNG(wxLANGUAGE_SANSKRIT, "sa" , LANG_SANSKRIT , SUBLANG_DEFAULT , wxLayout_LeftToRight, "Sanskrit")