Commit 9e390091 authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

comctl32: toolbar: Fix IDB_STD_VIEW_* icons count (with testcase).

parent d457b37d
......@@ -149,6 +149,7 @@ static void test_add_bitmap(void)
TBADDBITMAP bmp128;
TBADDBITMAP bmp80;
TBADDBITMAP stdsmall;
TBADDBITMAP addbmp;
INT ret;
/* empty 128x15 bitmap */
......@@ -240,6 +241,36 @@ static void test_add_bitmap(void)
UpdateWindow(hToolbar);
CHECK_IMAGELIST_TODO_COUNT_SIZE(28, 16, 15);
/* check standard bitmaps */
addbmp.hInst = HINST_COMMCTRL;
addbmp.nID = IDB_STD_SMALL_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(15, 16, 15);
addbmp.nID = IDB_STD_LARGE_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(15, 24, 24);
addbmp.nID = IDB_VIEW_SMALL_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(12, 16, 15);
addbmp.nID = IDB_VIEW_LARGE_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(12, 24, 24);
addbmp.nID = IDB_HIST_SMALL_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(5, 16, 15);
addbmp.nID = IDB_HIST_LARGE_COLOR;
rebuild_toolbar(&hToolbar);
ok(SendMessageA(hToolbar, TB_ADDBITMAP, 1, (LPARAM)&addbmp) == 0, "TB_ADDBITMAP - unexpected return\n");
CHECK_IMAGELIST(5, 24, 24);
DestroyWindow(hToolbar);
}
......
......@@ -2591,7 +2591,7 @@ TOOLBAR_AddBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
if ((lpAddBmp->nID & ~1) == IDB_STD_SMALL_COLOR)
nButtons = 15;
else if ((lpAddBmp->nID & ~1) == IDB_VIEW_SMALL_COLOR)
nButtons = 13;
nButtons = 12;
else if ((lpAddBmp->nID & ~1) == IDB_HIST_SMALL_COLOR)
nButtons = 5;
else
......
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