Fix return value of wxCalendarComboPopup::ParseDateTime()

Don't pretend that empty string represents a valid date, this made no
sense and resulted in unwanted events with an invalid date on clearing
the text part of the generic wxDatePickerCtrl.
This commit is contained in:
Vadim Zeitlin
2018-07-30 22:03:21 +02:00
parent 9293634af1
commit b8401d2fb5

View File

@@ -125,12 +125,9 @@ public:
{ {
wxASSERT(pDt); wxASSERT(pDt);
if ( !s.empty() )
{
pDt->ParseFormat(s, m_format); pDt->ParseFormat(s, m_format);
if ( !pDt->IsValid() ) if ( !pDt->IsValid() )
return false; return false;
}
return true; return true;
} }
@@ -253,7 +250,7 @@ private:
virtual void SetStringValue(const wxString& s) wxOVERRIDE virtual void SetStringValue(const wxString& s) wxOVERRIDE
{ {
wxDateTime dt; wxDateTime dt;
if ( !s.empty() && ParseDateTime(s, &dt) ) if ( ParseDateTime(s, &dt) )
SetDate(dt); SetDate(dt);
//else: keep the old value //else: keep the old value
} }