Commit 15fc2369 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ImageList_Remove returns TRUE when removing all images of an empty

ImageList.
parent e1050238
......@@ -2292,6 +2292,8 @@ ImageList_Remove (HIMAGELIST himl, INT i)
HDC hdcSrc, hdcDst;
INT cxNew, nCount;
TRACE("(himl=%p i=%d)\n", himl, i);
if (himl == NULL) {
ERR("Invalid image list handle!\n");
return FALSE;
......@@ -2302,14 +2304,13 @@ ImageList_Remove (HIMAGELIST himl, INT i)
return FALSE;
}
if (himl->cCurImage == 0) {
ERR("image list is already empty!\n");
return FALSE;
}
if (i == -1) {
/* remove all */
TRACE("remove all!\n");
if (himl->cCurImage == 0) {
/* remove all on empty ImageList is allowed */
TRACE("remove all on empty ImageList!\n");
return TRUE;
}
himl->cMaxImage = himl->cInitial + himl->cGrow;
himl->cCurImage = 0;
......@@ -3051,4 +3052,3 @@ ImageList_Write (HIMAGELIST himl, LPSTREAM pstm)
return TRUE;
}
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