From f30bd8f2620617ebbd1fd96d00a6fda514ceeb64 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 16 Apr 2010 11:29:09 +0000 Subject: [PATCH] Add wxLOCALE_DONT_LOAD_DEFAULT (=0) for clarity. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/intl.h | 5 +++-- interface/wx/intl.h | 1 + samples/internat/internat.cpp | 2 +- tests/intl/intltest.cpp | 2 +- tests/strings/strings.cpp | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/wx/intl.h b/include/wx/intl.h index 28bb8ce166..5572139112 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -408,8 +408,9 @@ enum wxLocaleInfo enum wxLocaleInitFlags { - wxLOCALE_LOAD_DEFAULT = 0x0001, // load wxwin.mo? - wxLOCALE_CONV_ENCODING = 0x0002 // convert encoding on the fly? + wxLOCALE_DONT_LOAD_DEFAULT = 0x0000, // don't load wxwin.mo + wxLOCALE_LOAD_DEFAULT = 0x0001, // load wxwin.mo? + wxLOCALE_CONV_ENCODING = 0x0002 // convert encoding on the fly? }; class WXDLLIMPEXP_BASE wxLocale diff --git a/interface/wx/intl.h b/interface/wx/intl.h index b0e0567fcb..0345f2cf69 100644 --- a/interface/wx/intl.h +++ b/interface/wx/intl.h @@ -762,6 +762,7 @@ public: - wxLOCALE_LOAD_DEFAULT: Load the message catalog for the given locale containing the translations of standard wxWidgets messages automatically. + - wxLOCALE_DONT_LOAD_DEFAULT: Negation of wxLOCALE_LOAD_DEFAULT. - wxLOCALE_CONV_ENCODING: Automatically convert message catalogs to platform's default encoding. Note that it will do only basic conversion between well-known pair like iso8859-1 and windows-1252 or diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index 7a5c5b65a3..ba9b735ad9 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -229,7 +229,7 @@ bool MyApp::OnInit() // don't use wxLOCALE_LOAD_DEFAULT flag so that Init() doesn't return // false just because it failed to load wxstd catalog - if ( !m_locale.Init(m_lang, wxLOCALE_CONV_ENCODING) ) + if ( !m_locale.Init(m_lang, wxLOCALE_DONT_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) ) { wxLogWarning(_("This language is not supported by the system.")); diff --git a/tests/intl/intltest.cpp b/tests/intl/intltest.cpp index 094d6bedf5..0e6b8948b4 100644 --- a/tests/intl/intltest.cpp +++ b/tests/intl/intltest.cpp @@ -75,7 +75,7 @@ void IntlTestCase::setUp() CPPUNIT_ASSERT( m_locale ); // don't load default catalog, it may be unavailable: - bool loaded = m_locale->Init(wxLANGUAGE_FRENCH, wxLOCALE_CONV_ENCODING); + bool loaded = m_locale->Init(wxLANGUAGE_FRENCH, wxLOCALE_DONT_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); CPPUNIT_ASSERT( loaded ); m_locale->AddCatalog("internat"); diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp index bc8a02817c..cdba4098bc 100644 --- a/tests/strings/strings.cpp +++ b/tests/strings/strings.cpp @@ -720,7 +720,7 @@ void StringTestCase::ToDouble() wxLocale *locale = new wxLocale; // don't load default catalog, it may be unavailable: - CPPUNIT_ASSERT( locale->Init(wxLANGUAGE_FRENCH, wxLOCALE_CONV_ENCODING) ); + CPPUNIT_ASSERT( locale->Init(wxLANGUAGE_FRENCH, wxLOCALE_DONT_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING) ); static const struct ToDoubleData doubleData2[] = { -- 2.47.2