X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dac7d53a83c862235ad8f3dfe5706e9af4c1480a..a148cfb64451d6553cf66d1075b654e54e908210:/src/common/intl.cpp?ds=sidebyside diff --git a/src/common/intl.cpp b/src/common/intl.cpp index e78f74483a..e2a7299f7a 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -202,6 +202,8 @@ private: inline size_t32 Swap(size_t32 ui) const; bool m_bSwapped; // wrong endianness? + + DECLARE_NO_COPY_CLASS(wxMsgCatalogFile) }; @@ -609,6 +611,8 @@ bool wxLocale::Init(const wxChar *szName, { // the argument to setlocale() szLocale = szShort; + + wxCHECK_MSG( szLocale, FALSE, _T("no locale to set in wxLocale::Init()") ); } m_pszOldLocale = wxSetlocale(LC_ALL, szLocale); if ( m_pszOldLocale == NULL ) @@ -764,11 +768,18 @@ bool wxLocale::Init(int language, int flags) wxMB2WXbuf retloc = wxSetlocale(LC_ALL , wxEmptyString); #else return FALSE; + #define WX_NO_LOCALE_SUPPORT #endif - return Init(name, canonical, retloc, - (flags & wxLOCALE_LOAD_DEFAULT) != 0, - (flags & wxLOCALE_CONV_ENCODING) != 0); +#ifndef WX_NO_LOCALE_SUPPORT + wxChar *szLocale = retloc ? wxStrdup(retloc) : NULL; + bool ret = Init(name, canonical, retloc, + (flags & wxLOCALE_LOAD_DEFAULT) != 0, + (flags & wxLOCALE_CONV_ENCODING) != 0); + if (szLocale) + free(szLocale); + return ret; +#endif }