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