From c57f6f8b5c848b9287a8ae7e9dd99ec38ec20e68 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 24 Feb 2024 19:42:56 +0300 Subject: CCtrlRichEdit::GetPlainRtf - a method to get plain (non-Unicode) text in RTF --- plugins/TabSRMM/src/msgdialog.cpp | 4 ++-- plugins/TabSRMM/src/msgdlgother.cpp | 4 ++-- plugins/TabSRMM/src/msgs.h | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index cc86a06bf9..46088dabc7 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -924,7 +924,7 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) CHARRANGE sel; LOG()->WndProc(EM_EXGETSEL, 0, (LPARAM)&sel); if (sel.cpMin != sel.cpMax) { - ptrA szFromStream(LOG()->GetRichTextRtf(true, true)); + ptrA szFromStream(LOG()->RTF().GetRichTextRtf(true, true)); ptrW converted(mir_utf8decodeW(szFromStream)); Utils::FilterEventMarkers(converted); szQuoted = Srmm_Quote(converted, iOutputWidth); @@ -1674,7 +1674,7 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter) cr.cpMin = cr.cpMax; if (isCtrl) { SETTEXTEX stx = { ST_KEEPUNDO | ST_SELECTION, CP_UTF8 }; - ptrA streamOut(LOG()->GetRichTextRtf(!isAlt, true)); + ptrA streamOut(LOG()->RTF().GetRichTextRtf(!isAlt, true)); if (streamOut) { Utils::FilterEventMarkers(streamOut); m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)streamOut); diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 5e728eedc1..4ee9fc0d87 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -3024,13 +3024,13 @@ LRESULT CMsgDialog::WMCopyHandler(UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT result = mir_callNextSubclass(m_pLog->GetHwnd(), stubLogProc, msg, wParam, lParam); - ptrA szFromStream(LOG()->GetRichTextRtf(true, true)); + ptrA szFromStream(LOG()->RTF().GetRichTextRtf(true, true)); if (szFromStream != nullptr) { ptrW converted(mir_utf8decodeW(szFromStream)); if (converted != nullptr) { Utils::FilterEventMarkers(converted); - ptrA szRtf(LOG()->GetRichTextRtf(false, true)); + ptrA szRtf(LOG()->RTF().GetPlainRtf(true)); Utils_ClipboardCopy(MClipUnicode(converted) + MClipRtf(szRtf)); } } diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index e7895a7fa4..cdeed7ec54 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -694,14 +694,12 @@ public: void ScrollToBottom() override; void UpdateOptions() override; - void DisableStaticEdge() - { + void DisableStaticEdge() { SetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_rtf.GetHwnd(), GWL_EXSTYLE) & ~WS_EX_STATICEDGE); } - char *GetRichTextRtf(bool bText, bool bSelection) - { - return m_rtf.GetRichTextRtf(bText, bSelection); + CCtrlRichEdit& RTF() const { + return m_rtf; } void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend, DB::EventInfo *dbei); -- cgit v1.2.3