mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 17:05:45 +00:00
- Partially revert r42993 for imagelist
See issue #4304 for more details. svn path=/trunk/; revision=43336
This commit is contained in:
parent
e7e971167b
commit
7ae4b30b8e
1 changed files with 6 additions and 7 deletions
|
@ -156,7 +156,7 @@ static inline void imagelist_copy_images( HIMAGELIST himl, HDC hdcSrc, HDC hdcDe
|
||||||
* This function CANNOT be used to reduce the number of images.
|
* This function CANNOT be used to reduce the number of images.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy)
|
IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cy)
|
||||||
{
|
{
|
||||||
HDC hdcBitmap;
|
HDC hdcBitmap;
|
||||||
HBITMAP hbmNewBitmap, hbmNull;
|
HBITMAP hbmNewBitmap, hbmNull;
|
||||||
|
@ -167,15 +167,14 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
|
||||||
&& (himl->cy >= cy))
|
&& (himl->cy >= cy))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (cx == 0) cx = himl->cx;
|
|
||||||
nNewCount = himl->cCurImage + nImageCount + himl->cGrow;
|
nNewCount = himl->cCurImage + nImageCount + himl->cGrow;
|
||||||
|
|
||||||
imagelist_get_bitmap_size(himl, nNewCount, cx, &sz);
|
imagelist_get_bitmap_size(himl, nNewCount, himl->cx, &sz);
|
||||||
|
|
||||||
TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, sz.cx, cy, nNewCount);
|
TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, sz.cx, cy, nNewCount);
|
||||||
hdcBitmap = CreateCompatibleDC (0);
|
hdcBitmap = CreateCompatibleDC (0);
|
||||||
|
|
||||||
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, cx);
|
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, himl->cx);
|
||||||
|
|
||||||
if (hbmNewBitmap == 0)
|
if (hbmNewBitmap == 0)
|
||||||
ERR("creating new image bitmap (x=%d y=%d)!\n", sz.cx, cy);
|
ERR("creating new image bitmap (x=%d y=%d)!\n", sz.cx, cy);
|
||||||
|
@ -249,7 +248,7 @@ ImageList_Add (HIMAGELIST himl, HBITMAP hbmImage, HBITMAP hbmMask)
|
||||||
|
|
||||||
nImageCount = bmp.bmWidth / himl->cx;
|
nImageCount = bmp.bmWidth / himl->cx;
|
||||||
|
|
||||||
IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight);
|
IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmHeight);
|
||||||
|
|
||||||
hdcBitmap = CreateCompatibleDC(0);
|
hdcBitmap = CreateCompatibleDC(0);
|
||||||
|
|
||||||
|
@ -351,7 +350,7 @@ ImageList_AddMasked (HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
|
||||||
else
|
else
|
||||||
nImageCount = 0;
|
nImageCount = 0;
|
||||||
|
|
||||||
IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmWidth, bmp.bmHeight);
|
IMAGELIST_InternalExpandBitmaps (himl, nImageCount, bmp.bmHeight);
|
||||||
|
|
||||||
nIndex = himl->cCurImage;
|
nIndex = himl->cCurImage;
|
||||||
himl->cCurImage += nImageCount;
|
himl->cCurImage += nImageCount;
|
||||||
|
@ -2305,7 +2304,7 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
|
||||||
|
|
||||||
if (nIndex == -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);
|
||||||
|
|
||||||
nIndex = himl->cCurImage;
|
nIndex = himl->cCurImage;
|
||||||
himl->cCurImage++;
|
himl->cCurImage++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue