From e78c4a1a2cbb082374cf01275b3237459accbda6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 5 Apr 2017 21:16:29 +0300 Subject: code cleaning --- plugins/TabSRMM/src/chat_log.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp index 10e0d74476..068868cff7 100644 --- a/plugins/TabSRMM/src/chat_log.cpp +++ b/plugins/TabSRMM/src/chat_log.cpp @@ -898,12 +898,6 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, bool bRedraw) // replace marked nicknames with hyperlinks to make the nicks clickable if (g_Settings.bClickableNicks) { FINDTEXTEX fi, fi2; - - CHARFORMAT2 cf2; - memset(&cf2, 0, sizeof(CHARFORMAT2)); - cf2.cbSize = sizeof(cf2); - - fi2.lpstrText = L"#++~~"; fi.chrg.cpMin = bRedraw ? 0 : sel.cpMin; fi.chrg.cpMax = -1; fi.lpstrText = L"~~++#"; @@ -911,18 +905,24 @@ void CChatRoomDlg::StreamInEvents(LOGINFO *lin, bool bRedraw) while (m_log.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi) > -1) { fi2.chrg.cpMin = fi.chrgText.cpMin; fi2.chrg.cpMax = -1; + fi2.lpstrText = L"#++~~"; if (m_log.SendMsg(EM_FINDTEXTEX, FR_DOWN, (LPARAM)&fi2) > -1) { m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&fi.chrgText); m_log.SendMsg(EM_REPLACESEL, TRUE, (LPARAM)L""); + fi2.chrgText.cpMin -= fi.chrgText.cpMax - fi.chrgText.cpMin; fi2.chrgText.cpMax -= fi.chrgText.cpMax - fi.chrgText.cpMin; m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&fi2.chrgText); m_log.SendMsg(EM_REPLACESEL, TRUE, (LPARAM)L""); - fi2.chrgText.cpMax = fi2.chrgText.cpMin; + fi2.chrgText.cpMax = fi2.chrgText.cpMin; fi2.chrgText.cpMin = fi.chrgText.cpMin; m_log.SendMsg(EM_EXSETSEL, 0, (LPARAM)&fi2.chrgText); + + CHARFORMAT2 cf2; + memset(&cf2, 0, sizeof(CHARFORMAT2)); + cf2.cbSize = sizeof(cf2); cf2.dwMask = CFM_PROTECTED; cf2.dwEffects = CFE_PROTECTED; m_log.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf2); -- cgit v1.2.3