DatePickerCtrl editor could crash if property had unspecified or otherwise incompatible value

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Jaakko Salli 2008-11-24 16:42:53 +00:00
parent d932a670ee
commit 5b4666dfbe

View File

@ -315,9 +315,16 @@ wxPGWindowList wxPGDatePickerCtrlEditor::CreateControls( wxPropertyGrid* propgri
#else
wxSize useSz = sz;
#endif
wxDateTime dateValue(wxInvalidDateTime);
wxVariant value = prop->GetValue();
if ( value.GetType() == wxT("datetime") )
dateValue = value.GetDateTime();
ctrl->Create(propgrid->GetPanel(),
wxPG_SUBID1,
prop->GetDateValue(),
dateValue,
pos,
useSz,
prop->GetDatePickerStyle() | wxNO_BORDER);