Remove unnecessary TempLocaleSetter::m_localeId

We don't need to store this string, we don't need it after the ctor.

Also change the default value of an argument of wxString reference type
to be a wxString, not a const char*.
This commit is contained in:
Vadim Zeitlin 2022-06-19 22:00:54 +02:00
parent db588c53f2
commit fe88494966

View File

@ -41,11 +41,12 @@ namespace
class TempLocaleSetter
{
public:
explicit TempLocaleSetter(int localeCategory, const wxString& localeId = "")
: m_localeCategory(localeCategory), m_localeId(localeId),
explicit TempLocaleSetter(int localeCategory,
const wxString& localeId = wxString())
: m_localeCategory(localeCategory),
m_localeOrig(strdup(setlocale(localeCategory, NULL)))
{
setlocale(localeCategory, m_localeId.mb_str());
setlocale(localeCategory, localeId.mb_str());
}
~TempLocaleSetter()
@ -56,7 +57,6 @@ public:
private:
const int m_localeCategory;
wxString m_localeId;
char* const m_localeOrig;
wxDECLARE_NO_COPY_CLASS(TempLocaleSetter);