]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for assert which happened if the checkbox was cleared in a control with wxDP_ALLO...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Dec 2006 21:31:32 +0000 (21:31 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 3 Dec 2006 21:31:32 +0000 (21:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43779 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/datectrl.cpp

index 68486ca9fdedf8f486b0ebf392839dfea9b0380f..8191af9fc37c098471381718464e12805efe57a6 100644 (file)
@@ -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
 
             // 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);
             {
                 m_date = dt;
                 wxDateEvent event(this, dt, wxEVT_DATE_CHANGED);
@@ -353,6 +354,7 @@ wxDatePickerCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                     return true;
                 }
             }
                     return true;
                 }
             }
+            //else: both the old and new values are invalid, nothing changed
         }
     }
 
         }
     }