Get rid of common "locale" variable in wxLocale::Init()
Try to make code less confusing by avoiding defining a variable in platform-independent part of the code and then actually using it only in platform-specific code.
This commit is contained in:
@@ -420,11 +420,10 @@ bool wxLocale::Init(int language, int flags)
|
|||||||
|
|
||||||
wxString name = info->Description;
|
wxString name = info->Description;
|
||||||
wxString canonical = info->CanonicalName;
|
wxString canonical = info->CanonicalName;
|
||||||
wxString locale;
|
|
||||||
|
|
||||||
// Set the locale:
|
// Set the locale:
|
||||||
#if defined(__UNIX__) && !defined(__WXMAC__)
|
#if defined(__UNIX__) && !defined(__WXMAC__)
|
||||||
locale = info->CanonicalName;
|
const wxString& locale = info->CanonicalName;
|
||||||
|
|
||||||
const char *retloc = wxSetlocaleTryUTF8(LC_ALL, locale);
|
const char *retloc = wxSetlocaleTryUTF8(LC_ALL, locale);
|
||||||
|
|
||||||
@@ -522,7 +521,7 @@ bool wxLocale::Init(int language, int flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// and also call setlocale() to change locale used by the CRT
|
// and also call setlocale() to change locale used by the CRT
|
||||||
locale = info->GetLocaleName();
|
const wxString locale = info->GetLocaleName();
|
||||||
if ( locale.empty() )
|
if ( locale.empty() )
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
@@ -551,7 +550,7 @@ bool wxLocale::Init(int language, int flags)
|
|||||||
if ( !retloc )
|
if ( !retloc )
|
||||||
ret = false;
|
ret = false;
|
||||||
#elif defined(__WXMAC__)
|
#elif defined(__WXMAC__)
|
||||||
locale = info->CanonicalName;
|
const wxString& locale = info->CanonicalName;
|
||||||
|
|
||||||
const char *retloc = wxSetlocale(LC_ALL, locale);
|
const char *retloc = wxSetlocale(LC_ALL, locale);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user