From bb0fa93f4a6425e5d78a8d1388f35edc152744a8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 12 Jul 2012 20:12:37 +0000 Subject: ok, this is war: all invalid icons are simply rejected git-svn-id: http://svn.miranda-ng.org/main/trunk@932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TopToolBar/toolbar.cpp | 26 +++++++++++++------------- plugins/TopToolBar/toolbarwnd.cpp | 3 --- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/plugins/TopToolBar/toolbar.cpp b/plugins/TopToolBar/toolbar.cpp index bbb4ee5932..976774acd9 100644 --- a/plugins/TopToolBar/toolbar.cpp +++ b/plugins/TopToolBar/toolbar.cpp @@ -296,22 +296,22 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) if (wParam == 0) return -1; - TopButtonInt* b; - { - mir_cslock lck(csButtonsHook); - - TTBButton *but = (TTBButton*)wParam; - if (but->cbSize != sizeof(TTBButton) && but->cbSize != OLD_TBBUTTON_SIZE) - return -1; + TTBButton *but = (TTBButton*)wParam; + if (but->cbSize != sizeof(TTBButton) && but->cbSize != OLD_TBBUTTON_SIZE) + return -1; - if ( !(but->dwFlags && TTBBF_ISLBUTTON) && nameexists(but->name)) - return -1; + if ( !(but->dwFlags && TTBBF_ISLBUTTON) && nameexists(but->name)) + return -1; - b = CreateButton(but); - b->hLangpack = (int)lParam; - b->LoadSettings(); + TopButtonInt* b = CreateButton(but); + b->hLangpack = (int)lParam; + b->LoadSettings(); + b->CreateWnd(); + if (b->hwnd == NULL) + return -1; + { + mir_cslock lck(csButtonsHook); Buttons.insert(b); - b->CreateWnd(); } g_ctrl->bOrderChanged = TRUE; diff --git a/plugins/TopToolBar/toolbarwnd.cpp b/plugins/TopToolBar/toolbarwnd.cpp index 4795810f19..d082464b4f 100644 --- a/plugins/TopToolBar/toolbarwnd.cpp +++ b/plugins/TopToolBar/toolbarwnd.cpp @@ -275,9 +275,6 @@ INT_PTR OnEventFire(WPARAM wParam, LPARAM lParam) 0, 0, 0, g_ctrl->nLastHeight, parent, NULL, hInst, NULL); SetWindowLongPtr(g_ctrl->hWnd, 0, (LPARAM)g_ctrl); - for (int i=0; i < Buttons.getCount(); i++) - Buttons[i]->CreateWnd(); - LoadBackgroundOptions(); // if we're working in skinned clist, receive the standard buttons & customizations -- cgit v1.2.3