Only use wxLocale functions if wxUSE_INTL == 1.
Don't use locale-dependent formats in wxDateTime::ParseFormat() when locale support is disabled. Closes #11121. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61731 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1048,11 +1048,12 @@ wxDateTime::ParseFormat(const wxString& date,
|
|||||||
{
|
{
|
||||||
wxDateTime dt;
|
wxDateTime dt;
|
||||||
|
|
||||||
|
#if wxUSE_INTL
|
||||||
const wxString
|
const wxString
|
||||||
fmtDateTime = wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT);
|
fmtDateTime = wxLocale::GetInfo(wxLOCALE_DATE_TIME_FMT);
|
||||||
if ( !fmtDateTime.empty() )
|
if ( !fmtDateTime.empty() )
|
||||||
dt = ParseFormatAt(input, end, fmtDateTime);
|
dt = ParseFormatAt(input, end, fmtDateTime);
|
||||||
|
#endif // wxUSE_INTL
|
||||||
if ( !dt.IsValid() )
|
if ( !dt.IsValid() )
|
||||||
{
|
{
|
||||||
// also try the format which corresponds to ctime()
|
// also try the format which corresponds to ctime()
|
||||||
@@ -1269,10 +1270,13 @@ wxDateTime::ParseFormat(const wxString& date,
|
|||||||
|
|
||||||
case wxT('x'): // locale default date representation
|
case wxT('x'): // locale default date representation
|
||||||
{
|
{
|
||||||
|
#if wxUSE_INTL
|
||||||
wxString
|
wxString
|
||||||
fmtDate = wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT),
|
fmtDate = wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT),
|
||||||
fmtDateAlt = wxLocale::GetInfo(wxLOCALE_LONG_DATE_FMT);
|
fmtDateAlt = wxLocale::GetInfo(wxLOCALE_LONG_DATE_FMT);
|
||||||
|
#else // !wxUSE_INTL
|
||||||
|
wxString fmtDate, fmtDateAlt;
|
||||||
|
#endif // wxUSE_INTL/!wxUSE_INTL
|
||||||
if ( fmtDate.empty() )
|
if ( fmtDate.empty() )
|
||||||
{
|
{
|
||||||
if ( IsWestEuropeanCountry(GetCountry()) ||
|
if ( IsWestEuropeanCountry(GetCountry()) ||
|
||||||
@@ -1317,9 +1321,12 @@ wxDateTime::ParseFormat(const wxString& date,
|
|||||||
|
|
||||||
case wxT('X'): // locale default time representation
|
case wxT('X'): // locale default time representation
|
||||||
{
|
{
|
||||||
|
#if wxUSE_INTL
|
||||||
wxString fmtTime = wxLocale::GetInfo(wxLOCALE_TIME_FMT),
|
wxString fmtTime = wxLocale::GetInfo(wxLOCALE_TIME_FMT),
|
||||||
fmtTimeAlt;
|
fmtTimeAlt;
|
||||||
|
#else // !wxUSE_INTL
|
||||||
|
wxString fmtTime, fmtTimeAlt;
|
||||||
|
#endif // wxUSE_INTL/!wxUSE_INTL
|
||||||
if ( fmtTime.empty() )
|
if ( fmtTime.empty() )
|
||||||
{
|
{
|
||||||
// try to parse what follows as "%H:%M:%S" and, if this
|
// try to parse what follows as "%H:%M:%S" and, if this
|
||||||
|
Reference in New Issue
Block a user