]> git.saurik.com Git - wxWidgets.git/commitdiff
DatePickerCtrl editor could crash if property had unspecified or otherwise incompatib...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 24 Nov 2008 16:42:53 +0000 (16:42 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 24 Nov 2008 16:42:53 +0000 (16:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/advprops.cpp

index b33a39eb2a60858770f3f20cda34500d97d1e685..dac42ea3209a42a4358841d5d38c07110829ad90 100644 (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);