From f9727b1be58d5cc9be85d12f8d47f3544f881b97 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Feb 2008 17:38:37 +0000 Subject: [PATCH] fixed wxXLocale(wxLanguage) ctor under Windows, use it instead of ctor from locale string in the test git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51637 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/xlocale.cpp | 4 ++++ tests/xlocale/xlocale.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/common/xlocale.cpp b/src/common/xlocale.cpp index 14c7a5b35c..e72fd843a0 100644 --- a/src/common/xlocale.cpp +++ b/src/common/xlocale.cpp @@ -88,7 +88,11 @@ wxXLocale::wxXLocale(wxLanguage lang) } else { +#ifdef __WXMSW__ + Init(info->Description); +#else Init(info->CanonicalName); +#endif } } diff --git a/tests/xlocale/xlocale.cpp b/tests/xlocale/xlocale.cpp index 157afad2b3..d0502e4887 100644 --- a/tests/xlocale/xlocale.cpp +++ b/tests/xlocale/xlocale.cpp @@ -65,8 +65,11 @@ void XLocaleTestCase::TestCtor() CPPUNIT_ASSERT( wxXLocale("C").IsOk() ); #ifdef wxHAS_XLOCALE_SUPPORT CPPUNIT_ASSERT( wxXLocale(wxLANGUAGE_FRENCH).IsOk() ); - CPPUNIT_ASSERT( wxXLocale("fr_FR").IsOk() ); +#ifdef __WXMSW__ CPPUNIT_ASSERT( wxXLocale("french").IsOk() ); +#else + CPPUNIT_ASSERT( wxXLocale("fr_FR").IsOk() ); +#endif #endif CPPUNIT_ASSERT( !wxXLocale("bloordyblop").IsOk() ); } @@ -169,7 +172,9 @@ void XLocaleTestCase::TestCtypeFunctions() TestCtypeFunctionsWith(wxCLocale); #ifdef wxHAS_XLOCALE_SUPPORT - wxXLocale locFR("fr_FR"); + wxXLocale locFR(wxLANGUAGE_FRENCH); + CPPUNIT_ASSERT( locFR.IsOk() ); // doesn't make sense to continue otherwise + TestCtypeFunctionsWith(locFR); CPPUNIT_ASSERT( wxIsalpha_l('é', locFR) );