Commit 4e5f56a8 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

comctl32: Remove another Nx1 assumption from ImageList_Remove().

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