comctl32/monthcal: Don't redraw after MCM_SETCURSEL if selection doesn't change.

This commit is contained in:
Nikolay Sivov 2009-09-25 03:13:38 +04:00 committed by Alexandre Julliard
parent c01ab1608c
commit 548645d360
1 changed files with 8 additions and 3 deletions

View File

@ -1001,12 +1001,17 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, SYSTEMTIME *curSel)
if(!MONTHCAL_ValidateTime(*curSel)) return FALSE;
infoPtr->currentMonth=curSel->wMonth;
infoPtr->currentYear=curSel->wYear;
MONTHCAL_CopyTime(curSel, &infoPtr->minSel);
MONTHCAL_CopyTime(curSel, &infoPtr->maxSel);
/* exit earlier if selection equals current */
if (infoPtr->currentMonth == curSel->wMonth &&
infoPtr->currentYear == curSel->wYear &&
infoPtr->curSelDay == curSel->wDay) return TRUE;
infoPtr->currentMonth = curSel->wMonth;
infoPtr->currentYear = curSel->wYear;
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
return TRUE;