comctl32/monthcal: Don't redraw if date didn't change on MCM_SETTODAY.

This commit is contained in:
Nikolay Sivov 2009-09-25 03:32:18 +04:00 committed by Alexandre Julliard
parent 534ea8ab42
commit decc86add9
1 changed files with 9 additions and 0 deletions

View File

@ -158,6 +158,12 @@ int MONTHCAL_MonthLength(int month, int year)
}
}
/* compares timestamps using date part only */
static inline BOOL MONTHCAL_IsDateEqual(const SYSTEMTIME *first, const SYSTEMTIME *second)
{
return (first->wYear == second->wYear) && (first->wMonth == second->wMonth) &&
(first->wDay == second->wDay);
}
/* make sure that time is valid */
static int MONTHCAL_ValidateTime(SYSTEMTIME time)
@ -1093,6 +1099,9 @@ MONTHCAL_SetToday(MONTHCAL_INFO *infoPtr, SYSTEMTIME *today)
TRACE("%p\n", today);
if(!today) return FALSE;
if(MONTHCAL_IsDateEqual(today, &infoPtr->todaysDate)) return TRUE;
MONTHCAL_CopyTime(today, &infoPtr->todaysDate);
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;