Separate creating wxUILocaleImpl from using it

Add Use() virtual function which can be used if the newly created
wxUILocaleImpl object should be used as the default UI locale.

Currently Use() is always called after creating a new wxUILocaleImpl, so
adding a separate function just seems to complicate matters needlessly,
but this won't be the case any more soon, when wxUILocaleImpl could be
created for using them for other purposes than making them the default.

No real changes yet.
This commit is contained in:
Vadim Zeitlin
2021-08-29 00:38:36 +02:00
parent 45ffc40fc2
commit 608718dd9c
5 changed files with 80 additions and 33 deletions

View File

@@ -142,7 +142,14 @@ public:
explicit wxUILocaleImplLCID(LCID lcid)
: m_lcid(lcid)
{
wxUseLCID(lcid);
}
bool Use() wxOVERRIDE
{
wxUseLCID(m_lcid);
// As long as we use a valid LCID (and we always do), it shouldn't fail.
return true;
}
wxString GetName() const wxOVERRIDE