[3/3] Changing the day of month BEFORE calculating the day of week this time. (try 3)

Vincent Povirk madewokherd at gmail.com
Thu Mar 31 15:58:46 CDT 2011


EVERY TIME I have to do anything different I forget to attach the patch.
-------------- next part --------------
From 3819553d703454c9a53ec2c6c66f8a8b1c9fc736 Mon Sep 17 00:00:00 2001
From: Vincent Povirk <vincent at codeweavers.com>
Date: Thu, 31 Mar 2011 14:41:00 -0500
Subject: [PATCH 3/3] comctl32: Validate the day of month when scrolling through years.

---
 dlls/comctl32/datetime.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c
index fd97fdd..abfef58 100644
--- a/dlls/comctl32/datetime.c
+++ b/dlls/comctl32/datetime.c
@@ -474,6 +474,9 @@ DATETIME_IncreaseField (DATETIME_INFO *infoPtr, int number, int delta)
 	case TWODIGITYEAR:
 	case FULLYEAR:
 	    date->wYear = wrap(date->wYear, delta, 1752, 9999);
+	    if (date->wDay > MONTHCAL_MonthLength(date->wMonth, date->wYear))
+	        /* This can happen when moving away from a leap year. */
+	        date->wDay = MONTHCAL_MonthLength(date->wMonth, date->wYear);
 	    MONTHCAL_CalculateDayOfWeek(date, TRUE);
 	    break;
 	case ONEDIGITMONTH:
-- 
1.7.1


More information about the wine-patches mailing list