From 0c8433d097488397700bdbbf1858e970c1f621e4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 3 Dec 2006 21:31:32 +0000 Subject: [PATCH] fix for assert which happened if the checkbox was cleared in a control with wxDP_ALLOWNONE style git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/datectrl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 68486ca9fd..8191af9fc3 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -343,7 +343,8 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) // filter out duplicate DTN_DATETIMECHANGE events which the native // control sends us when using wxDP_DROPDOWN style - if ( !m_date.IsValid() || dt != m_date ) + if ( (m_date.IsValid() != dt.IsValid()) || + (m_date.IsValid() && dt != m_date) ) { m_date = dt; wxDateEvent event(this, dt, wxEVT_DATE_CHANGED); @@ -353,6 +354,7 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) return true; } } + //else: both the old and new values are invalid, nothing changed } } -- 2.45.2