diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-08 16:57:24 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-08 16:57:24 +0300 |
commit | 43177ef97c1421502b5a2be9b8b62a6809fb29bf (patch) | |
tree | b2f27ba9258583afbf4633ef5736bc876bbc4111 /plugins/TabSRMM/src | |
parent | 7b19b6715a75c52e0285ee2031a8fa2ddace1da7 (diff) |
cosmetic code cleaning
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r-- | plugins/TabSRMM/src/buttonsbar.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_log.cpp | 7 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_main.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_tools.cpp | 2 | ||||
-rw-r--r-- | plugins/TabSRMM/src/chat_window.cpp | 6 |
5 files changed, 10 insertions, 13 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index a911db110a..eb52e2f727 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -206,8 +206,6 @@ BOOL CTabBaseDlg::BB_SetButtonsPos() if (!m_hwnd || !IsWindowVisible(m_hwnd)) return 0; - HWND hwndButton = 0; - BYTE gap = DPISCALEX_S(db_get_b(0, SRMSGMOD, "ButtonsBarGap", 1)); bool showToolbar = !(m_pContainer->dwFlags & CNT_HIDETOOLBAR); bool bBottomToolbar = (m_pContainer->dwFlags & CNT_BOTTOMTOOLBAR) != 0; @@ -247,7 +245,7 @@ BOOL CTabBaseDlg::BB_SetButtonsPos() continue; if (((m_bType == SESSIONTYPE_IM) && cbd->m_bIMButton) || ((m_bType == SESSIONTYPE_CHAT) && cbd->m_bChatButton)) { - hwndButton = GetDlgItem(m_hwnd, cbd->m_dwButtonCID); + HWND hwndButton = GetDlgItem(m_hwnd, cbd->m_dwButtonCID); if (!showToolbar) { ShowWindow(hwndButton, SW_HIDE); @@ -297,7 +295,7 @@ BOOL CTabBaseDlg::BB_SetButtonsPos() continue; if (((m_bType == SESSIONTYPE_IM) && cbd->m_bIMButton) || ((m_bType == SESSIONTYPE_CHAT) && cbd->m_bChatButton)) { - hwndButton = GetDlgItem(m_hwnd, cbd->m_dwButtonCID); + HWND hwndButton = GetDlgItem(m_hwnd, cbd->m_dwButtonCID); if (!showToolbar) { ShowWindow(hwndButton, SW_HIDE); diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp index a1fdf98a11..38d6a0d134 100644 --- a/plugins/TabSRMM/src/chat_log.cpp +++ b/plugins/TabSRMM/src/chat_log.cpp @@ -895,7 +895,7 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, SESSION_INFO *si, bool bRedraw) if (oldsel.cpMax != oldsel.cpMin)
SendMessage(hwndRich, WM_SETREDRAW, FALSE, 0);
- //set the insertion point at the bottom
+ // set the insertion point at the bottom
sel.cpMin = sel.cpMax = GetRichTextLength(hwndRich);
SendMessage(hwndRich, EM_EXSETSEL, 0, (LPARAM)&sel);
@@ -906,7 +906,7 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, SESSION_INFO *si, bool bRedraw) // should the event(s) be appended to the current log
WPARAM wp = bRedraw ? SF_RTF : SFF_SELECTION | SF_RTF;
- //get the number of pixels per logical inch
+ // get the number of pixels per logical inch
if (bRedraw) {
HDC hdc = GetDC(nullptr);
pci->logPixelSY = GetDeviceCaps(hdc, LOGPIXELSY);
@@ -914,7 +914,6 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, SESSION_INFO *si, bool bRedraw) ReleaseDC(nullptr, hdc);
SendMessage(hwndRich, WM_SETREDRAW, FALSE, 0);
bFlag = true;
- // SetCursor(LoadCursor(nullptr, IDC_ARROW));
}
// stream in the event(s)
@@ -997,7 +996,7 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, SESSION_INFO *si, bool bRedraw) SendMessage(hwndRich, EM_SETSEL, 0, fi.chrgText.cpMax + 1);
SendMessage(hwndRich, EM_REPLACESEL, TRUE, (LPARAM)L"");
}
- si->bTrimmed = FALSE;
+ si->bTrimmed = false;
}
// scroll log to bottom if the log was previously scrolled to bottom, else restore old position
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index aeac520800..570dd311be 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -36,7 +36,7 @@ TMUCSettings g_Settings; static void OnCreateSession(SESSION_INFO *si, MODULEINFO *mi)
{
- si->bFilterEnabled = db_get_b(si->hContact, "Chat", "FilterEnabled", M.GetByte("Chat", "FilterEnabled", 0));
+ si->bFilterEnabled = db_get_b(si->hContact, "Chat", "FilterEnabled", M.GetByte("Chat", "FilterEnabled", 0)) != 0;
Chat_SetFilters(si);
if (mi) {
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp index 68c5cf40a9..0292d434bc 100644 --- a/plugins/TabSRMM/src/chat_tools.cpp +++ b/plugins/TabSRMM/src/chat_tools.cpp @@ -649,7 +649,7 @@ void Chat_SetFilters(SESSION_INFO *si) }
if (si->iLogFilterFlags == 0)
- si->bFilterEnabled = 0;
+ si->bFilterEnabled = false;
}
char GetIndicator(SESSION_INFO *si, LPCTSTR ptszNick, int *iNickIndex)
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 90d1f524c2..25cd8b3d65 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -868,7 +868,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, UINT u = IsDlgButtonChecked(GetParent(hwnd), IDC_COLOR); if (index >= 0) { - mwdat->si->bFGSet = TRUE; + mwdat->si->bFGSet = true; mwdat->si->iFG = index; } @@ -884,7 +884,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, UINT u = IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR); if (index >= 0) { - mwdat->si->bBGSet = TRUE; + mwdat->si->bBGSet = true; mwdat->si->iBG = index; } @@ -1776,7 +1776,7 @@ void CChatRoomDlg::OnClick_Filter(CCtrlButton *pButton) if (si->iLogFilterFlags == 0 && !si->bFilterEnabled) { MessageBox(0, TranslateT("The filter cannot be enabled, because there are no event types selected either global or for this chat room"), TranslateT("Event filter error"), MB_OK); - si->bFilterEnabled = 0; + si->bFilterEnabled = false; } else si->bFilterEnabled = !si->bFilterEnabled; |