Commit 9e772d13 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

comctl32: Fix a potential regression in ImageList_ReplaceIcon().

parent 2614e0ee
...@@ -2253,6 +2253,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) ...@@ -2253,6 +2253,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
BITMAP bmp; BITMAP bmp;
BOOL ret; BOOL ret;
POINT pt; POINT pt;
INT i;
TRACE("(%p %d %p)\n", himl, i, hIcon); TRACE("(%p %d %p)\n", himl, i, hIcon);
...@@ -2317,14 +2318,17 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) ...@@ -2317,14 +2318,17 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
SetBkColor (himl->hdcImage, RGB(255,255,255)); SetBkColor (himl->hdcImage, RGB(255,255,255));
hbmOldSrc = SelectObject (hdcImage, ii.hbmColor); hbmOldSrc = SelectObject (hdcImage, ii.hbmColor);
imagelist_point_from_index(himl, nIndex, &pt); for (i=0; i<(bmp.bmWidth/himl->cx); i++) {
imagelist_point_from_index(himl, nIndex+i, &pt);
StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy, StretchBlt (himl->hdcImage, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); hdcImage, 0, 0, himl->cx*i, bmp.bmHeight, SRCCOPY);
if (himl->hbmMask) { if (himl->hbmMask) {
SelectObject (hdcImage, ii.hbmMask); SelectObject (hdcImage, ii.hbmMask);
StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy, StretchBlt (himl->hdcMask, pt.x, pt.y, himl->cx, himl->cy,
hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); hdcImage, 0, 0, himl->cx*i, bmp.bmHeight, SRCCOPY);
}
} }
SelectObject (hdcImage, hbmOldSrc); SelectObject (hdcImage, hbmOldSrc);
......
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