[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: comctl32: Use SetRect() instead of open coding it.
From:       Sebastian Lackner <sebastian () fds-team ! de>
Date:       2016-04-29 13:31:35
Message-ID: 7633b46e-2197-12d8-9851-63061774e2cc () fds-team ! de
[Download RAW message or body]

On 29.04.2016 15:29, Michael Stefaniuc wrote:
> On 04/29/2016 03:24 PM, Sebastian Lackner wrote:
>> On 29.04.2016 15:21, Michael Stefaniuc wrote:
>>> -    rcDragIcon.left = rcListBox.left - DRAGICON_HOTSPOT_X;
>>> -    rcDragIcon.top = rcItem.top - DRAGICON_HOTSPOT_Y;
>>> -    rcDragIcon.right = rcListBox.left;
>>> -    rcDragIcon.bottom = rcDragIcon.top + DRAGICON_HEIGHT;
>>> +    SetRect(&rcDragIcon, rcListBox.left - DRAGICON_HOTSPOT_X, rcItem.top - DRAGICON_HOTSPOT_Y,
>>> +            rcListBox.left, rcDragIcon.top + DRAGICON_HEIGHT);
>>
>> This won't work as expected. Haven't checked if there are more similar cases.
> Argghh! Missed that one.
> For whatever reason the coccinelle rule to prevent this isn't catching
> it if it happens in the last argument to the function call.  I had
> manually eliminated two other cases like this but missed this one.
> 
> bye
> 	michael
> 

Seems like its not the only one ;)

> @@ -2136,10 +2135,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC  hdc, INT  iItem)
>  
>  	  /* Now erase the top corner and draw diagonal edge */
>  	  SetBkColor(hdc, corner);
> -	  r1.left = r.right - ROUND_CORNER_SIZE - 1;
> -	  r1.top = r.top;
> -	  r1.right = r.right;
> -	  r1.bottom = r1.top + ROUND_CORNER_SIZE;
> +          SetRect(&r1, r.right - ROUND_CORNER_SIZE - 1, r.top, r.right, r1.top + ROUND_CORNER_SIZE);
>  	  ExtTextOutW(hdc, 0, 0, 2, &r1, NULL, 0, 0);
>  	  r1.right--;
>  	  DrawEdge(hdc, &r1, EDGE_RAISED, BF_SOFT|BF_DIAGONAL_ENDTOPLEFT);




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic