Only set wxLocale as active once it has been fully initialized
Previously wxLocale object was set as the global local as soon as it was
created, even when the default ctor was used, i.e. the locale wasn't
really changed at all. This was always wrong, but only started to result
in visible problems since the changes of c6d6ec9295
(Merge branch
'msw-fix-decimal-point' of https://github.com/vslavik/wxWidgets,
2021-04-18) as we now could use the existing but not yet active locale
when checking for the decimal separator mismatch, resulting in spurious
asserts.
Fix this by postponing the call to wxSetLocale() and the rest of what
was previously done in the ctor until Init() is called (which is done by
all non default ctors).
Closes https://github.com/wxWidgets/wxWidgets/pull/2350
Closes #19154.
This commit is contained in:
@@ -333,8 +333,8 @@ public:
|
||||
static void DestroyLanguagesDB();
|
||||
|
||||
private:
|
||||
// This method is trivial and just updates the corresponding member
|
||||
// variables without doing anything else.
|
||||
// This method updates the member fields when this locale is actually set
|
||||
// as active.
|
||||
void DoInit(const wxString& name,
|
||||
const wxString& shortName,
|
||||
int language);
|
||||
@@ -343,7 +343,8 @@ private:
|
||||
// m_langugagesInfo, called by InitLanguagesDB
|
||||
static void InitLanguagesDB();
|
||||
|
||||
// initialize the member fields to default values
|
||||
// This method is trivial and just initializes the member fields to default
|
||||
// values.
|
||||
void DoCommonInit();
|
||||
|
||||
// After trying to set locale, call this method to give the appropriate
|
||||
|
Reference in New Issue
Block a user