comctl32/monthcal: Use memcpy to copy day state arrays.

This commit is contained in:
Nikolay Sivov 2010-07-19 21:54:40 +04:00 committed by Alexandre Julliard
parent fdabf10a97
commit b486c50523
1 changed files with 3 additions and 8 deletions

View File

@ -1384,13 +1384,10 @@ MONTHCAL_GetRange(const MONTHCAL_INFO *infoPtr, SYSTEMTIME *range)
static LRESULT static LRESULT
MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, INT months, MONTHDAYSTATE *states) MONTHCAL_SetDayState(const MONTHCAL_INFO *infoPtr, INT months, MONTHDAYSTATE *states)
{ {
int i; TRACE("%p %d %p\n", infoPtr, months, states);
TRACE("%d %p\n", months, states);
if(months != infoPtr->monthRange) return 0; if(months != infoPtr->monthRange) return 0;
for(i = 0; i < months; i++) memcpy(infoPtr->monthdayState, states, months*sizeof(MONTHDAYSTATE));
infoPtr->monthdayState[i] = states[i];
return 1; return 1;
} }
@ -1748,7 +1745,6 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
{ {
if(infoPtr->dwStyle & MCS_DAYSTATE) { if(infoPtr->dwStyle & MCS_DAYSTATE) {
NMDAYSTATE nmds; NMDAYSTATE nmds;
INT i;
nmds.nmhdr.hwndFrom = infoPtr->hwndSelf; nmds.nmhdr.hwndFrom = infoPtr->hwndSelf;
nmds.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); nmds.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
@ -1762,8 +1758,7 @@ static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr)
nmds.stStart.wDay = 1; nmds.stStart.wDay = 1;
SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds);
for(i = 0; i < infoPtr->monthRange; i++) memcpy(infoPtr->monthdayState, nmds.prgDayState, infoPtr->monthRange*sizeof(MONTHDAYSTATE));
infoPtr->monthdayState[i] = nmds.prgDayState[i];
Free(nmds.prgDayState); Free(nmds.prgDayState);
} }