[comctl32] MonthCalendar - Fix wrong date selected when clicknext/prev months day (#6967)

Dmitry Timoshkov dmitry at codeweavers.com
Mon Dec 25 03:54:09 CST 2006


"Vijay Kiran Kamuju" <infyquest at gmail.com> wrote:

> -  retval = *daypos + (7 * *weekpos) - firstDay;
> +  retval = *daypos + ((7 * *weekpos) - firstDay);
>    return retval;
>  }

This change doesn't make any difference, neither in functionality,
nor in readability IMO. Please avoid this kind of changes, it only
clutters the patch, making it hard to see what is the real change.
 
> -   lpht->st.wDay   = MONTHCAL_MonthLength(lpht->st.wMonth,lpht->st.wYear) -day;
> +   lpht->st.wDay   = day+MONTHCAL_MonthLength(lpht->st.wMonth,lpht->st.wYear) ;

A couple of spaces around '+' won't hurt, and a space before ';' doesn't match
an existing code style.

> -    return TRUE;
> +    /*return TRUE;*/

If you are not sure that the return should be removed, it's a sign that you
need a test case, just commenting it out without any explanation is not a solution.
Same comment to all other similar cases.

> +    MONTHCAL_CopyTime(&infoPtr->minSel,&nmsc.stSelStart);
> +    MONTHCAL_CopyTime(&infoPtr->maxSel,&nmsc.stSelEnd);
>      nmsc.nmhdr.hwndFrom = infoPtr->hwndSelf;
>      nmsc.nmhdr.idFrom   = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID);
>      nmsc.nmhdr.code     = MCN_SELCHANGE;
> -    MONTHCAL_CopyTime(&infoPtr->minSel,&nmsc.stSelStart);
> -    MONTHCAL_CopyTime(&infoPtr->maxSel,&nmsc.stSelEnd);

This change is not needed.
 
-- 
Dmitry.




More information about the wine-devel mailing list