summaryrefslogtreecommitdiff
path: root/plugins/TopToolBar
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-07-12 20:12:37 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-07-12 20:12:37 +0000
commitbb0fa93f4a6425e5d78a8d1388f35edc152744a8 (patch)
treed8f77ecc3ed88453d52ac7036ac63ec99ca60e3a /plugins/TopToolBar
parent17c26d63b27afb740b83ac3a1b9fe9073a332d0b (diff)
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
Diffstat (limited to 'plugins/TopToolBar')
-rw-r--r--plugins/TopToolBar/toolbar.cpp26
-rw-r--r--plugins/TopToolBar/toolbarwnd.cpp3
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