]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/calctrl.cpp
Preserve client data pointers when setting bitmaps in wxBitmapComboBox.
[wxWidgets.git] / src / msw / calctrl.cpp
index 7d80380b9389e6dbf6bddce66e1ba7dbd06c650f..6af1285b681b58171d227779fee0e1e81f5ad4c4 100644 (file)
@@ -474,7 +474,9 @@ bool wxCalendarCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                 wxDateTime startDate;
                 startDate.SetFromMSWSysDate(ds->stStart);
 
-                wxDateTime currentDate = m_date;
+                // Ensure we have a valid date to work with.
+                wxDateTime currentDate = m_date.IsValid() ? m_date : startDate;
+
                 // Set to the start of month for comparison with startDate to
                 // work correctly.
                 currentDate.SetDay(1);