summaryrefslogtreecommitdiff
path: root/src/modules/button/button.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-07 21:50:44 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-07 21:50:44 +0000
commit2236e9a252983edcce561223534041629935d750 (patch)
tree8425c78b92568a3a8931f5bab07ed3eea86ae067 /src/modules/button/button.cpp
parentacfdcaaea2a735e2bf2dcf2c3144f429081078c0 (diff)
various code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@6820 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/button/button.cpp')
-rw-r--r--src/modules/button/button.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp
index c99048f3db..2f6c2f4a01 100644
--- a/src/modules/button/button.cpp
+++ b/src/modules/button/button.cpp
@@ -283,12 +283,12 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
SendMessage(bct->hwndToolTips, TTM_DELTOOL, 0, (LPARAM)&ti);
if (SendMessage(bct->hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM)&ti) == 0) {
- int idx;
TTooltips tt;
tt.ThreadId = GetCurrentThreadId();
mir_cslock lck(csTips);
- if ((idx = lToolTips.getIndex(&tt)) != -1) {
+ int idx = lToolTips.getIndex(&tt);
+ if (idx != -1) {
mir_free(lToolTips[idx]);
lToolTips.remove(idx);
DestroyWindow(bct->hwndToolTips);
@@ -462,14 +462,13 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case BUTTONADDTOOLTIP:
if (wParam) {
- TOOLINFO ti = {0};
if ( !bct->hwndToolTips) {
- int idx;
TTooltips tt;
tt.ThreadId = GetCurrentThreadId();
mir_cslock lck(csTips);
- if ((idx = lToolTips.getIndex(&tt)) != -1)
+ int idx = lToolTips.getIndex(&tt);
+ if (idx != -1)
bct->hwndToolTips = lToolTips[idx]->hwnd;
else {
TTooltips *ptt = (TTooltips*)mir_alloc(sizeof(TTooltips));
@@ -479,6 +478,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
bct->hwndToolTips = ptt->hwnd;
}
}
+ TOOLINFO ti = {0};
ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND;
ti.hwnd = bct->hwnd;