diff --git a/docs/changes.txt b/docs/changes.txt index 0933ccdc11..39c07a8333 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -93,8 +93,8 @@ Major new features in 2.8 release All: -- Fixed bug with parsing some dates in wxDateTime (Bob Pesner) -- Fixed bug with parsing negative time zones in wxDateTime::ParseRfc822Date() +- Fixed bug with parsing some dates in wxDateTime (Bob Pesner). +- Fixed bug with parsing negative time zones in wxDateTime::ParseRfc822Date(). All (GUI): @@ -107,8 +107,9 @@ All (GUI): - wxNotebook RTTI corrected, so now wxDynamicCast(notebook, wxBookCtrlBase) works. - When focus is set to wxScrolledWindow child, scroll it into view. -- Improve wximage::ResampleBox() (Mihai Ciocarlie) -- Implemented ScrollList() in generic wxListCtrl (Tim Kosse) +- Improve wximage::ResampleBox() (Mihai Ciocarlie). +- Implemented ScrollList() in generic wxListCtrl (Tim Kosse). +- SaveAs in docview takes into account path now. All (Unix): @@ -117,13 +118,14 @@ All (Unix): wxMSW: -- Fix rare bug with messages delivered to wrong wxSocket (Tim Kosse) -- Fix setting icons when they have non-default (16*16 and 32*32) sizes +- Fix rare bug with messages delivered to wrong wxSocket (Tim Kosse). +- Fix setting icons when they have non-default (16*16 and 32*32) sizes. +- Fixed wxLocale::GetInfo to use the C locale. wxGTK: - Return false from wxEventLoop::Dispatch() if gtk_main_quit() was called and - so the loop should exit (Rodolfo Schulz de Lima) + so the loop should exit (Rodolfo Schulz de Lima). 2.8.7 diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 9271bc70de..8527fb5f43 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -2739,8 +2739,8 @@ bool wxLocale::IsAvailable(int lang) return false; #elif defined(__UNIX__) - - // Test if setting the locale works, then set it back. + + // Test if setting the locale works, then set it back. wxMB2WXbuf oldLocale = wxSetlocale(LC_ALL, wxEmptyString); wxMB2WXbuf tmp = wxSetlocaleTryUTF(LC_ALL, info->CanonicalName); if ( !tmp ) @@ -2751,8 +2751,8 @@ bool wxLocale::IsAvailable(int lang) return false; } // restore the original locale - wxSetlocale(LC_ALL, oldLocale); -#endif + wxSetlocale(LC_ALL, oldLocale); +#endif return true; } @@ -2818,6 +2818,18 @@ bool wxLocale::AddCatalog(const wxChar *szDomain, /* static */ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) { + wxUint32 lcid = LOCALE_USER_DEFAULT; + + if (wxGetLocale()) + { + const wxLanguageInfo *info = GetLanguageInfo(wxGetLocale()->GetLanguage()); + if (info) + { ; + lcid = MAKELCID(MAKELANGID(info->WinLang, info->WinSublang), + SORT_DEFAULT); + } + } + wxString str; wxChar buffer[256]; size_t count; @@ -2825,7 +2837,7 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) switch (index) { case wxLOCALE_DECIMAL_POINT: - count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, buffer, 256); + count = ::GetLocaleInfo(lcid, LOCALE_SDECIMAL, buffer, 256); if (!count) str << wxT("."); else @@ -2833,14 +2845,14 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) break; #if 0 case wxSYS_LIST_SEPARATOR: - count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLIST, buffer, 256); + count = ::GetLocaleInfo(lcid, LOCALE_SLIST, buffer, 256); if (!count) str << wxT(","); else str << buffer; break; case wxSYS_LEADING_ZERO: // 0 means no leading zero, 1 means leading zero - count = ::GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, buffer, 256); + count = ::GetLocaleInfo(lcid, LOCALE_ILZERO, buffer, 256); if (!count) str << wxT("0"); else