Commit 65a2e59a authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

comctl32: Avoid using CopyRect() on RECT structs.

parent e201dcac
...@@ -264,7 +264,7 @@ VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem) ...@@ -264,7 +264,7 @@ VOID WINAPI DrawInsert (HWND hwndParent, HWND hwndLB, INT nItem)
RedrawWindow(hwndParent, &data->last_drag_icon_rect, NULL, RedrawWindow(hwndParent, &data->last_drag_icon_rect, NULL,
RDW_INTERNALPAINT | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW); RDW_INTERNALPAINT | RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
CopyRect(&data->last_drag_icon_rect, &rcDragIcon); data->last_drag_icon_rect = rcDragIcon;
if (nItem >= 0) if (nItem >= 0)
{ {
......
...@@ -3856,9 +3856,8 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord ...@@ -3856,9 +3856,8 @@ static void LISTVIEW_MarqueeHighlight(LISTVIEW_INFO *infoPtr, const POINT *coord
iterator_frameditems_absolute(&old_elems, infoPtr, &infoPtr->marqueeRect); iterator_frameditems_absolute(&old_elems, infoPtr, &infoPtr->marqueeRect);
CopyRect(&infoPtr->marqueeRect, &rect); infoPtr->marqueeRect = rect;
infoPtr->marqueeDrawRect = rect;
CopyRect(&infoPtr->marqueeDrawRect, &rect);
OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y); OffsetRect(&infoPtr->marqueeDrawRect, offset->x, offset->y);
iterator_frameditems_absolute(&new_elems, infoPtr, &infoPtr->marqueeRect); iterator_frameditems_absolute(&new_elems, infoPtr, &infoPtr->marqueeRect);
......
...@@ -355,7 +355,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc) ...@@ -355,7 +355,7 @@ static LRESULT PROGRESS_Draw (PROGRESS_INFO *infoPtr, HDC hdc)
DrawThemeParentBackground (infoPtr->Self, hdc, NULL); DrawThemeParentBackground (infoPtr->Self, hdc, NULL);
DrawThemeBackground (pdi.theme, hdc, part, 0, &pdi.rect, NULL); DrawThemeBackground (pdi.theme, hdc, part, 0, &pdi.rect, NULL);
SelectClipRgn (hdc, NULL); SelectClipRgn (hdc, NULL);
CopyRect (&pdi.rect, &cntRect); pdi.rect = cntRect;
} }
/* compute some drawing parameters */ /* compute some drawing parameters */
......
...@@ -3219,7 +3219,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam) ...@@ -3219,7 +3219,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
if (bm.bmWidth < r.right || bm.bmHeight < r.bottom) if (bm.bmWidth < r.right || bm.bmHeight < r.bottom)
{ {
hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0)); hbr = CreateSolidBrush(GetPixel(hdcSrc, 0, 0));
CopyRect(&r, &rzone); r = rzone;
if (bm.bmWidth < r.right) if (bm.bmWidth < r.right)
{ {
r.left = bm.bmWidth; r.left = bm.bmWidth;
......
...@@ -80,7 +80,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c ...@@ -80,7 +80,7 @@ static void paint_text (HWND hwnd, HDC hdc, DWORD dwStyle, const COMBOBOXINFO *c
/* /*
* Give ourselves some space. * Give ourselves some space.
*/ */
CopyRect (&rectEdit, &cbi->rcItem); rectEdit = cbi->rcItem;
InflateRect( &rectEdit, -1, -1 ); InflateRect( &rectEdit, -1, -1 );
if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE)) if(dwStyle & (CBS_OWNERDRAWFIXED | CBS_OWNERDRAWVARIABLE))
...@@ -187,8 +187,7 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state) ...@@ -187,8 +187,7 @@ static LRESULT paint (HTHEME theme, HWND hwnd, HDC hParamDC, ULONG state)
GetClientRect (hwnd, &frameRect); GetClientRect (hwnd, &frameRect);
else else
{ {
CopyRect (&frameRect, &cbi.rcItem); frameRect = cbi.rcItem;
InflateRect(&frameRect, InflateRect(&frameRect,
EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE, EDIT_CONTROL_PADDING + COMBO_XBORDERSIZE,
EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE); EDIT_CONTROL_PADDING + COMBO_YBORDERSIZE);
......
...@@ -876,7 +876,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, ...@@ -876,7 +876,7 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
rc = btnPtr->rect; rc = btnPtr->rect;
CopyRect (&rcArrow, &rc); rcArrow = rc;
/* separator - doesn't send NM_CUSTOMDRAW */ /* separator - doesn't send NM_CUSTOMDRAW */
if (btnPtr->fsStyle & BTNS_SEP) { if (btnPtr->fsStyle & BTNS_SEP) {
...@@ -929,8 +929,8 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, ...@@ -929,8 +929,8 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc,
/* copy text & bitmap rects after adjusting for drop-down arrow /* copy text & bitmap rects after adjusting for drop-down arrow
* so that text & bitmap is centered in the rectangle not containing * so that text & bitmap is centered in the rectangle not containing
* the arrow */ * the arrow */
CopyRect(&rcText, &rc); rcText = rc;
CopyRect(&rcBitmap, &rc); rcBitmap = rc;
/* Center the bitmap horizontally and vertically */ /* Center the bitmap horizontally and vertically */
if (dwStyle & TBSTYLE_LIST) if (dwStyle & TBSTYLE_LIST)
...@@ -2648,9 +2648,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ...@@ -2648,9 +2648,9 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
lpdis->rcItem.right, lpdis->rcItem.bottom); lpdis->rcItem.right, lpdis->rcItem.bottom);
/* calculate button and text rectangles */ /* calculate button and text rectangles */
CopyRect (&rcButton, &lpdis->rcItem); rcButton = lpdis->rcItem;
InflateRect (&rcButton, -1, -1); InflateRect (&rcButton, -1, -1);
CopyRect (&rcText, &rcButton); rcText = rcButton;
rcButton.right = rcButton.left + custInfo->tbInfo->nBitmapWidth + 6; rcButton.right = rcButton.left + custInfo->tbInfo->nBitmapWidth + 6;
rcText.left = rcButton.right + 2; rcText.left = rcButton.right + 2;
...@@ -5550,7 +5550,7 @@ TOOLBAR_LButtonDown (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -5550,7 +5550,7 @@ TOOLBAR_LButtonDown (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
RECT arrowRect; RECT arrowRect;
infoPtr->nOldHit = nHit; infoPtr->nOldHit = nHit;
CopyRect(&arrowRect, &btnPtr->rect); arrowRect = btnPtr->rect;
arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH); arrowRect.left = max(btnPtr->rect.left, btnPtr->rect.right - DDARROW_WIDTH);
/* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */ /* for EX_DRAWDDARROWS style, click must be in the drop-down arrow rect */
......
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