Nikolay Sivov : comctl32/monthcal: Fix hittesting for MCHT_CALENDARDATEPREV /MCHT_CALENDARDATENEXT cases.

Alexandre Julliard julliard at winehq.org
Wed Sep 30 10:56:07 CDT 2009


Module: wine
Branch: master
Commit: 344f07007b7b25de4831e2cf6a30b4a901a37354
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=344f07007b7b25de4831e2cf6a30b4a901a37354

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Tue Sep 29 23:30:49 2009 +0400

comctl32/monthcal: Fix hittesting for MCHT_CALENDARDATEPREV/MCHT_CALENDARDATENEXT cases.

---

 dlls/comctl32/monthcal.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c
index e0d5fcd..583260d 100644
--- a/dlls/comctl32/monthcal.c
+++ b/dlls/comctl32/monthcal.c
@@ -1210,30 +1210,30 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht)
     goto done;
   }
   if(PtInRect(&infoPtr->days, lpht->pt))
-    {
+  {
       lpht->st.wYear  = infoPtr->curSel.wYear;
       if ( day < 1)
-	{
+      {
 	  retval = MCHT_CALENDARDATEPREV;
 	  lpht->st.wMonth = infoPtr->curSel.wMonth - 1;
-	  if (lpht->st.wMonth <1)
-	    {
+	  if (lpht->st.wMonth < 1)
+	  {
 	      lpht->st.wMonth = 12;
 	      lpht->st.wYear--;
-	    }
-	  lpht->st.wDay   = MONTHCAL_MonthLength(lpht->st.wMonth,lpht->st.wYear) -day;
-	}
+	  }
+	  lpht->st.wDay = MONTHCAL_MonthLength(lpht->st.wMonth,lpht->st.wYear) + day;
+      }
       else if (day > MONTHCAL_MonthLength(infoPtr->curSel.wMonth,infoPtr->curSel.wYear))
-	{
+      {
 	  retval = MCHT_CALENDARDATENEXT;
 	  lpht->st.wMonth = infoPtr->curSel.wMonth + 1;
-	  if (lpht->st.wMonth <12)
-	    {
+	  if (lpht->st.wMonth > 12)
+	  {
 	      lpht->st.wMonth = 1;
 	      lpht->st.wYear++;
-	    }
-	  lpht->st.wDay   = day - MONTHCAL_MonthLength(infoPtr->curSel.wMonth,infoPtr->curSel.wYear) ;
-	}
+	  }
+	  lpht->st.wDay = day - MONTHCAL_MonthLength(infoPtr->curSel.wMonth,infoPtr->curSel.wYear);
+      }
       else {
 	retval = MCHT_CALENDARDATE;
 	lpht->st.wMonth = infoPtr->curSel.wMonth;




More information about the wine-cvs mailing list