comctl32: toolbar[3/3]: we shouldn't try to resize standard bitmaps
Mikołaj Zalewski
mikolaj at zalewski.pl
Mon Mar 19 13:37:41 CDT 2007
I don't think any app depends on this but this allows to remove the last
todo_wine in TB_ADDBITMAP tests.
-------------- next part --------------
From a6d8b85d2774295321785c1d05d6c4ea17d23c2e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Mon, 19 Mar 2007 18:57:25 +0100
Subject: [PATCH] comctl32: toolbar: we shouldn't try to resize standard bitmaps
---
dlls/comctl32/tests/toolbar.c | 24 +-----------------------
dlls/comctl32/toolbar.c | 3 ++-
2 files changed, 3 insertions(+), 24 deletions(-)
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 43c93dd..d5b055e 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -190,28 +190,6 @@ static void rebuild_toolbar_with_buttons(HWND *hToolbar)
} \
}
-#define CHECK_IMAGELIST_TODO_COUNT(count, dx, dy) { \
- int cx, cy; \
- HIMAGELIST himl = (HIMAGELIST)SendMessageA(hToolbar, TB_GETIMAGELIST, 0, 0); \
- ok(himl != NULL, "No image list\n"); \
- if (himl != NULL) {\
- todo_wine ok(ImageList_GetImageCount(himl) == count, "Images count mismatch - %d vs %d\n", count, ImageList_GetImageCount(himl)); \
- ImageList_GetIconSize(himl, &cx, &cy); \
- ok(cx == dx && cy == dy, "Icon size mismatch - %dx%d vs %dx%d\n", dx, dy, cx, cy); \
- } \
-}
-
-#define CHECK_IMAGELIST_TODO_COUNT_SIZE(count, dx, dy) { \
- int cx, cy; \
- HIMAGELIST himl = (HIMAGELIST)SendMessageA(hToolbar, TB_GETIMAGELIST, 0, 0); \
- ok(himl != NULL, "No image list\n"); \
- if (himl != NULL) {\
- todo_wine ok(ImageList_GetImageCount(himl) == count, "Images count mismatch - %d vs %d\n", count, ImageList_GetImageCount(himl)); \
- ImageList_GetIconSize(himl, &cx, &cy); \
- todo_wine ok(cx == dx && cy == dy, "Icon size mismatch - %dx%d vs %dx%d\n", dx, dy, cx, cy); \
- } \
-}
-
static void test_add_bitmap(void)
{
HWND hToolbar = NULL;
@@ -358,7 +336,7 @@ static void test_add_bitmap(void)
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 0, (LPARAM)&stdsmall) == 1, "TB_SETBITMAPSIZE failed\n");
UpdateWindow(hToolbar);
compare((int)SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0), MAKELONG(23, 22), "%x");
- CHECK_IMAGELIST_TODO_COUNT(22, 20, 15);
+ CHECK_IMAGELIST(22, 20, 15);
/* check standard bitmaps */
addbmp.hInst = HINST_COMMCTRL;
diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c
index c40ced0..c17e7b9 100644
--- a/dlls/comctl32/toolbar.c
+++ b/dlls/comctl32/toolbar.c
@@ -2669,7 +2669,8 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB
/* enlarge the bitmap if needed */
ImageList_GetIconSize(himlDef, &cxIcon, &cyIcon);
- COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
+ if (bitmap->hInst != COMCTL32_hModule)
+ COMCTL32_EnsureBitmapSize(&hbmLoad, cxIcon*(INT)bitmap->nButtons, cyIcon, comctl32_color.clrBtnFace);
nIndex = ImageList_AddMasked(himlDef, hbmLoad, comctl32_color.clrBtnFace);
DeleteObject(hbmLoad);
--
1.4.4.2
More information about the wine-patches
mailing list