From b6c0516b0535f9f4dc14cd4c6ea506762d56cf3e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Dec 2016 19:04:41 +0300 Subject: small fixes --- plugins/TabSRMM/src/msgs.cpp | 2 +- protocols/MSN/src/msn_links.cpp | 3 --- src/core/stdmsg/src/msgdialog.cpp | 5 ++--- src/mir_app/src/srmm_toolbar.cpp | 10 ++++------ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 951034efc0..fb07d79f7d 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -936,7 +936,7 @@ int IconsChanged(WPARAM, LPARAM) static void TSAPI InitAPI() { CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand); - CreateServiceFunction(MS_MSG_SENDMESSAGE "W", SendMessageCommand_W); + CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W); CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI); CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass); CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData); diff --git a/protocols/MSN/src/msn_links.cpp b/protocols/MSN/src/msn_links.cpp index 35ab65cfa3..118da3da41 100644 --- a/protocols/MSN/src/msn_links.cpp +++ b/protocols/MSN/src/msn_links.cpp @@ -113,7 +113,6 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) arg += 5; MCONTACT hContact = GetContact(arg, NULL, proto); - if (hContact != NULL) { CallService(MS_MSG_SENDMESSAGE, hContact, 0); return 0; @@ -123,7 +122,6 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) arg += 6; MCONTACT hContact = GetContact(arg, NULL, proto); - if (hContact != NULL) { CallService(MS_MSG_SENDMESSAGE, hContact, 0); return 0; @@ -133,7 +131,6 @@ static INT_PTR ServiceParseMsnimLink(WPARAM, LPARAM lParam) arg += 6; MCONTACT hContact = GetContact(arg, NULL, proto); - if (hContact != NULL) { CallService(MS_MSG_SENDMESSAGE, hContact, 0); return 0; 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); -- cgit v1.2.3