summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-24 19:42:56 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-24 19:42:56 +0300
commitc57f6f8b5c848b9287a8ae7e9dd99ec38ec20e68 (patch)
tree69e07ee12fc4eaf07cdb32cfc274b4b30cfddc4a /plugins/TabSRMM/src
parent1beaee1f0efba88cbea9f1a93627fcce164b17e7 (diff)
CCtrlRichEdit::GetPlainRtf - a method to get plain (non-Unicode) text in RTF
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdlgother.cpp4
-rw-r--r--plugins/TabSRMM/src/msgs.h8
3 files changed, 7 insertions, 9 deletions
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);