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:
parent
9293634af1
commit
b8401d2fb5
@ -125,12 +125,9 @@ public:
|
||||
{
|
||||
wxASSERT(pDt);
|
||||
|
||||
if ( !s.empty() )
|
||||
{
|
||||
pDt->ParseFormat(s, m_format);
|
||||
if ( !pDt->IsValid() )
|
||||
return false;
|
||||
}
|
||||
pDt->ParseFormat(s, m_format);
|
||||
if ( !pDt->IsValid() )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -253,7 +250,7 @@ private:
|
||||
virtual void SetStringValue(const wxString& s) wxOVERRIDE
|
||||
{
|
||||
wxDateTime dt;
|
||||
if ( !s.empty() && ParseDateTime(s, &dt) )
|
||||
if ( ParseDateTime(s, &dt) )
|
||||
SetDate(dt);
|
||||
//else: keep the old value
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user