]> git.saurik.com Git - wxWidgets.git/commitdiff
Patch from Ricardo Pedroso that fixes a segfault when the
authorRobin Dunn <robin@alldunn.com>
Thu, 26 May 2005 17:33:41 +0000 (17:33 +0000)
committerRobin Dunn <robin@alldunn.com>
Thu, 26 May 2005 17:33:41 +0000 (17:33 +0000)
wxCAL_SEQUENTIAL_MONTH_SELECTION style is used.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34349 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/calctrl.cpp

index 92fb7051e9e91a646d25f738a2d066c66118b513..13645353de2363fb6805bccbfacf970ed3e8921e 100644 (file)
@@ -753,11 +753,12 @@ wxSize wxCalendarCtrl::DoGetBestSize() const
         // the combobox doesn't report its height correctly (it returns the
         // height including the drop down list) so don't use it
         height += m_spinYear->GetBestSize().y;
         // the combobox doesn't report its height correctly (it returns the
         // height including the drop down list) so don't use it
         height += m_spinYear->GetBestSize().y;
-    }
+
 
        wxCoord w2= m_comboMonth->GetBestSize().x + HORZ_MARGIN + GetCharWidth()*6;
        if (width < w2)
          width=w2;
 
        wxCoord w2= m_comboMonth->GetBestSize().x + HORZ_MARGIN + GetCharWidth()*6;
        if (width < w2)
          width=w2;
+    }
 
     if ( !HasFlag(wxBORDER_NONE) )
     {
 
     if ( !HasFlag(wxBORDER_NONE) )
     {
@@ -891,7 +892,7 @@ void wxCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         dc.SetTextForeground(*wxBLACK);
         dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID));
         dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID));
         dc.SetTextForeground(*wxBLACK);
         dc.SetBrush(wxBrush(m_colHeaderBg, wxSOLID));
         dc.SetPen(wxPen(m_colHeaderBg, 1, wxSOLID));
-        dc.DrawRectangle(x0, y, GetClientSize().x, m_heightRow);
+        dc.DrawRectangle(0, y, GetClientSize().x, m_heightRow);
 
         // Get extent of month-name + year
         wxCoord monthw, monthh;
 
         // Get extent of month-name + year
         wxCoord monthw, monthh;