Fixed GetInfo to use the current language.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@51135 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2008-01-09 15:54:42 +00:00
parent 51d48f09cf
commit 1b7e34be56
2 changed files with 28 additions and 14 deletions

View File

@@ -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

View File

@@ -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