Commit f3c6114d authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

comctl32: Remove a redundant variable.

parent 9e772d13
...@@ -2243,10 +2243,9 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage, ...@@ -2243,10 +2243,9 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage,
*/ */
INT WINAPI INT WINAPI
ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
{ {
HDC hdcImage; HDC hdcImage;
INT nIndex;
HICON hBestFitIcon; HICON hBestFitIcon;
HBITMAP hbmOldSrc; HBITMAP hbmOldSrc;
ICONINFO ii; ICONINFO ii;
...@@ -2255,14 +2254,14 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) ...@@ -2255,14 +2254,14 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
POINT pt; POINT pt;
INT i; INT i;
TRACE("(%p %d %p)\n", himl, i, hIcon); TRACE("(%p %d %p)\n", himl, nIndex, hIcon);
if (!is_valid(himl)) { if (!is_valid(himl)) {
ERR("invalid image list\n"); ERR("invalid image list\n");
return -1; return -1;
} }
if ((i >= himl->cMaxImage) || (i < -1)) { if ((nIndex >= himl->cMaxImage) || (nIndex < -1)) {
ERR("invalid image index %d / %d\n", i, himl->cMaxImage); ERR("invalid image index %d / %d\n", nIndex, himl->cMaxImage);
return -1; return -1;
} }
...@@ -2299,15 +2298,13 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon) ...@@ -2299,15 +2298,13 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
return -1; return -1;
} }
if (i == -1) { if (nIndex == -1) {
if (himl->cCurImage + 1 > himl->cMaxImage) if (himl->cCurImage + 1 > himl->cMaxImage)
IMAGELIST_InternalExpandBitmaps (himl, 1, 0, 0); IMAGELIST_InternalExpandBitmaps (himl, 1, 0, 0);
nIndex = himl->cCurImage; nIndex = himl->cCurImage;
himl->cCurImage++; himl->cCurImage++;
} }
else
nIndex = i;
hdcImage = CreateCompatibleDC (0); hdcImage = CreateCompatibleDC (0);
TRACE("hdcImage=%p\n", hdcImage); TRACE("hdcImage=%p\n", hdcImage);
......
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