Mike McCormack : comctl32: Remove Nx1 assumptions in ImageList_GetIcon().
Module: wine Branch: master Commit: 9cd86dddf1af73cc9255cf63dc0cf928e336f731 URL: http://source.winehq.org/git/wine.git/?a=commit;h=9cd86dddf1af73cc9255cf63dc... Author: Mike McCormack <mike(a)codeweavers.com> Date: Sun Nov 5 17:09:47 2006 +0900 comctl32: Remove Nx1 assumptions in ImageList_GetIcon(). --- dlls/comctl32/imagelist.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index 91dc7a5..3db07e5 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -1441,6 +1441,7 @@ ImageList_GetIcon (HIMAGELIST himl, INT HICON hIcon; HBITMAP hOldDstBitmap; HDC hdcDst; + POINT pt; TRACE("%p %d %d\n", himl, i, fStyle); if (!is_valid(himl) || (i < 0) || (i >= himl->cCurImage)) return NULL; @@ -1456,12 +1457,14 @@ ImageList_GetIcon (HIMAGELIST himl, INT hdcDst = CreateCompatibleDC(0); + imagelist_point_from_index( himl, i, &pt ); + /* draw mask*/ ii.hbmMask = CreateBitmap (himl->cx, himl->cy, 1, 1, NULL); hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask); if (himl->hbmMask) { BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, - himl->hdcMask, i * himl->cx, 0, SRCCOPY); + himl->hdcMask, pt.x, pt.y, SRCCOPY); } else PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS); @@ -1469,7 +1472,7 @@ ImageList_GetIcon (HIMAGELIST himl, INT /* draw image*/ SelectObject (hdcDst, ii.hbmColor); BitBlt (hdcDst, 0, 0, himl->cx, himl->cy, - himl->hdcImage, i * himl->cx, 0, SRCCOPY); + himl->hdcImage, pt.x, pt.y, SRCCOPY); /* * CreateIconIndirect requires us to deselect the bitmaps from
participants (1)
-
Alexandre Julliard