Commit decc86ad authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 534ea8ab
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment