From 5b4666dfbe35c5a9f0159c81f0401fb6db6c11f3 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Mon, 24 Nov 2008 16:42:53 +0000 Subject: [PATCH 1/1] 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 --- src/propgrid/advprops.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index b33a39eb2a..dac42ea320 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -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); -- 2.45.2