]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/calctrl.cpp
Fix problem with COMDLG_FILTERSPEC declaration with MinGW-w64 4.8.
[wxWidgets.git] / src / msw / calctrl.cpp
index 467ced1e8c930497be4df747fcbd08ceac00846a..ac0d8bbd7600db54373a107f49b6bab689a4df53 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxCalendarCtrl implementation
 // Author:      Vadim Zeitlin
 // Created:     2008-04-04
-// RCS-ID:      $Id$
 // Copyright:   (C) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -109,7 +108,7 @@ wxCalendarCtrl::Create(wxWindow *parent,
     }
 
     const wxChar * const clsname = s_clsMonthCal.IsRegistered()
-        ? s_clsMonthCal.GetName().wx_str()
+        ? s_clsMonthCal.GetName().t_str()
         : MONTHCAL_CLASS;
 
     if ( !MSWCreateControl(clsname, wxEmptyString, pos, size) )
@@ -474,7 +473,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);