diff options
author | George Hazan <ghazan@miranda.im> | 2017-04-05 21:16:29 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-04-05 21:16:29 +0300 |
commit | e78c4a1a2cbb082374cf01275b3237459accbda6 (patch) | |
tree | b8c1ef17602c327f0eb67c27776f87b7a0518d97 | |
parent | d2e4278bdb83a3cb11f0af0f974216f6850cc720 (diff) |
code cleaning
-rw-r--r-- | plugins/TabSRMM/src/chat_log.cpp | 14 | ||||
-rw-r--r-- | src/mir_core/src/CCtrlRichEdit.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
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);
diff --git a/src/mir_core/src/CCtrlRichEdit.cpp b/src/mir_core/src/CCtrlRichEdit.cpp index 136bbf116a..cc87958e66 100644 --- a/src/mir_core/src/CCtrlRichEdit.cpp +++ b/src/mir_core/src/CCtrlRichEdit.cpp @@ -33,7 +33,7 @@ int CCtrlRichEdit::GetRichTextLength(int iCodePage) const { GETTEXTLENGTHEX gtl; gtl.codepage = iCodePage; - gtl.flags = GTL_PRECISE | GTL_USECRLF; + gtl.flags = GTL_PRECISE; if (iCodePage == CP_ACP) gtl.flags |= GTL_NUMBYTES; else |