Use LocaleSetter class in wxTextCtrl test case

Replace manual calls to setlocale() with the existing helper class.

This makes the code slightly simpler and avoids -Wnoexcept-type warnings
due to using setlocale as template argument as a welcome side effect.
This commit is contained in:
Vadim Zeitlin
2020-07-06 12:32:38 +02:00
parent d2e03dec77
commit de6b4e4095

View File

@@ -24,7 +24,6 @@
#endif // WX_PRECOMP
#include "wx/scopedptr.h"
#include "wx/scopeguard.h"
#include "wx/uiaction.h"
#if wxUSE_CLIPBOARD
@@ -290,8 +289,7 @@ void TextCtrlTestCase::StreamInput()
#ifndef __WXOSX__
{
// Ensure we use decimal point and not a comma.
char * const locOld = setlocale(LC_NUMERIC, "C");
wxON_BLOCK_EXIT2( setlocale, (int)LC_NUMERIC, locOld );
LocaleSetter setCLocale("C");
*m_text << "stringinput"
<< 10