comctl32: Remove another Nx1 assumption from ImageList_Remove().

This commit is contained in:
Mike McCormack 2006-11-05 17:10:54 +09:00 committed by Alexandre Julliard
parent ca6be70819
commit 4e5f56a8e0

View File

@ -2073,7 +2073,8 @@ ImageList_Remove (HIMAGELIST himl, INT i)
{
HBITMAP hbmNewImage, hbmNewMask;
HDC hdcBmp;
INT cxNew, nCount;
INT nCount;
SIZE sz;
TRACE("(himl=%p i=%d)\n", himl, i);
@ -2106,7 +2107,6 @@ ImageList_Remove (HIMAGELIST himl, INT i)
himl->hbmImage = hbmNewImage;
if (himl->hbmMask) {
SIZE sz;
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
@ -2121,7 +2121,6 @@ ImageList_Remove (HIMAGELIST himl, INT i)
/* create new bitmap(s) */
nCount = (himl->cCurImage + himl->cGrow - 1);
cxNew = nCount * himl->cx;
TRACE(" - Number of images: %d / %d (Old/New)\n",
himl->cCurImage, himl->cCurImage - 1);
@ -2130,8 +2129,9 @@ ImageList_Remove (HIMAGELIST himl, INT i)
hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cy);
imagelist_get_bitmap_size(himl, nCount, himl->cy, &sz );
if (himl->hbmMask)
hbmNewMask = CreateBitmap (cxNew, himl->cy, 1, 1, NULL);
hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
else
hbmNewMask = 0; /* Just to keep compiler happy! */