summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-04 19:04:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-04 19:04:55 +0300
commitb6c0516b0535f9f4dc14cd4c6ea506762d56cf3e (patch)
tree960dfb2c07ccef5439b6e89ca09a3588d1170bb0 /src
parentf49a3ebbe5c0f420ce328b5db3c1723cd0af4ed0 (diff)
small fixes
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp5
-rw-r--r--src/mir_app/src/srmm_toolbar.cpp10
2 files changed, 6 insertions, 9 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 28b1199d7d..0209a74695 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -617,13 +617,12 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
NotifyLocalWinEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_OPENING);
if (newData->szInitialText) {
- int len;
-
if (newData->isWchar)
SetDlgItemText(hwndDlg, IDC_MESSAGE, (wchar_t*)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
- len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
+
+ int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
}
diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp
index caf9335836..e3e93a29b2 100644
--- a/src/mir_app/src/srmm_toolbar.cpp
+++ b/src/mir_app/src/srmm_toolbar.cpp
@@ -158,16 +158,15 @@ MIR_APP_DLL(int) Srmm_GetButtonState(HWND hwndDlg, BBButton *bbdi)
return 1;
DWORD tempCID = 0;
- bool realbutton = false;
bbdi->bbbFlags = 0;
for (int i = 0; i < arButtonsList.getCount(); i++) {
CustomButtonData *cbd = arButtonsList[i];
if (!mir_strcmp(cbd->m_pszModuleName, bbdi->pszModuleName) && (cbd->m_dwButtonOrigID == bbdi->dwButtonID)) {
- realbutton = true;
tempCID = cbd->m_dwButtonCID;
+ break;
}
}
- if (!realbutton)
+ if (!tempCID)
return 1;
HWND hwndBtn = GetDlgItem(hwndDlg, tempCID);
@@ -180,16 +179,15 @@ MIR_APP_DLL(int) Srmm_SetButtonState(MCONTACT hContact, BBButton *bbdi)
if (hContact == NULL || bbdi == NULL)
return 1;
- bool realbutton = false;
DWORD tempCID = 0;
for (int i = 0; i < arButtonsList.getCount(); i++) {
CustomButtonData *cbd = arButtonsList[i];
if (!mir_strcmp(cbd->m_pszModuleName, bbdi->pszModuleName) && (cbd->m_dwButtonOrigID == bbdi->dwButtonID)) {
- realbutton = true;
tempCID = cbd->m_dwButtonCID;
+ break;
}
}
- if (!realbutton)
+ if (!tempCID)
return 1;
HWND hwndDlg = WindowList_Find(NULL, hContact);