Handle wxDateTime data in wxDataViewModel only if wxUSE_DATETIME==1.

Code using wxDateTime datatype in wxDataViewModel::Compare should be active
only if wxUSE_DATETIME is enabled.

See #16939.
This commit is contained in:
Artur Wieczorek 2015-04-03 21:45:07 +02:00 committed by Vadim Zeitlin
parent 69005ef145
commit a088915a56

View File

@ -343,6 +343,7 @@ int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem
else if (d1 > d2)
return 1;
}
#if wxUSE_DATETIME
else if (value1.GetType() == wxT("datetime"))
{
wxDateTime dt1 = value1.GetDateTime();
@ -352,6 +353,7 @@ int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem
if (dt2.IsEarlierThan(dt1))
return 1;
}
#endif // wxUSE_DATETIME
else if (value1.GetType() == wxT("bool"))
{
bool b1 = value1.GetBool();