mirror of
https://github.com/reactos/wine.git
synced 2025-01-22 03:49:02 +00:00
comctl32: imagelist: SetImageCount can be used to decrease image count (with testcase).
This commit is contained in:
parent
80664defa8
commit
89f537dd57
@ -2546,11 +2546,12 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
|
||||
|
||||
if (!is_valid(himl))
|
||||
return FALSE;
|
||||
if (himl->cCurImage >= iImageCount)
|
||||
return FALSE;
|
||||
if (iImageCount < 0)
|
||||
return FALSE;
|
||||
if (himl->cMaxImage > iImageCount)
|
||||
{
|
||||
himl->cCurImage = iImageCount;
|
||||
/* TODO: shrink the bitmap when cMaxImage-cCurImage>cGrow ? */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -327,6 +327,14 @@ static BOOL DoTest1(void)
|
||||
/* remove one extra */
|
||||
ok(!ImageList_Remove(himl,0),"removed nonexistent icon\n");
|
||||
|
||||
/* check SetImageCount/GetImageCount */
|
||||
ok(ImageList_SetImageCount(himl, 3), "couldn't increase image count\n");
|
||||
ok(ImageList_GetImageCount(himl) == 3, "invalid image count after increase\n");
|
||||
ok(ImageList_SetImageCount(himl, 1), "couldn't decrease image count\n");
|
||||
ok(ImageList_GetImageCount(himl) == 1, "invalid image count after decrease to 1\n");
|
||||
ok(ImageList_SetImageCount(himl, 0), "couldn't decrease image count\n");
|
||||
ok(ImageList_GetImageCount(himl) == 0, "invalid image count after decrease to 0\n");
|
||||
|
||||
/* destroy it */
|
||||
ok(ImageList_Destroy(himl),"destroy imagelist failed\n");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user