diff options
author | George Hazan <george.hazan@gmail.com> | 2024-10-01 15:09:57 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-10-01 15:09:57 +0300 |
commit | 54dff9bda866e580e3be4e202adc3c8cdb368228 (patch) | |
tree | 1afc07df1d46960ce73f2e895e9d3179dec21a71 /plugins/TabSRMM | |
parent | 53221d7d7853d463f5703c8b1d95447f501c834d (diff) |
code cleaning
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 27 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgother.cpp | 2 |
2 files changed, 10 insertions, 19 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index f21c2431ce..d510320768 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -894,25 +894,16 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) if (selected != nullptr)
szQuoted = Srmm_Quote(selected, iOutputWidth);
else {
- MEVENT hDBEvent = db_event_last(m_hContact);
- if (hDBEvent == 0)
- return;
-
- if (m_iLogMode == WANT_BUILTIN_LOG) {
- CHARRANGE sel;
- LOG()->WndProc(EM_EXGETSEL, 0, (LPARAM)&sel);
- if (sel.cpMin != sel.cpMax) {
- ptrA szFromStream(LOG()->RTF().GetRichTextRtf(true, true));
- ptrW converted(mir_utf8decodeW(szFromStream));
- Utils::FilterEventMarkers(converted);
- szQuoted = Srmm_Quote(converted, iOutputWidth);
- }
- }
+ ptrW wszSelection(m_pLog->GetSelectedText());
+ if (mir_wstrlen(wszSelection))
+ szQuoted = Srmm_Quote(wszSelection, iOutputWidth);
if (szQuoted.IsEmpty()) {
- DB::EventInfo dbei(hDBEvent);
- if (dbei)
- szQuoted = Srmm_Quote(ptrW(dbei.getText()), iOutputWidth);
+ if (MEVENT hDBEvent = db_event_last(m_hContact)) {
+ DB::EventInfo dbei(hDBEvent);
+ if (dbei)
+ szQuoted = Srmm_Quote(ptrW(dbei.getText()), iOutputWidth);
+ }
}
}
@@ -1458,7 +1449,7 @@ int CMsgDialog::OnFilter(MSGFILTER *pFilter) File::Send(m_hContact);
return _dlgReturn(m_hwnd, 1);
case TABSRMM_HK_QUOTEMSG:
- SendMessage(m_hwnd, WM_COMMAND, IDC_QUOTE, 0);
+ m_btnQuote.Click();
return _dlgReturn(m_hwnd, 1);
case TABSRMM_HK_CLEARMSG:
m_message.SetText(L"");
diff --git a/plugins/TabSRMM/src/msgdlgother.cpp b/plugins/TabSRMM/src/msgdlgother.cpp index 1317a38f3c..d4f8e5a196 100644 --- a/plugins/TabSRMM/src/msgdlgother.cpp +++ b/plugins/TabSRMM/src/msgdlgother.cpp @@ -1910,7 +1910,7 @@ void CMsgDialog::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt) pCtrl.SendMsg(EM_PASTESPECIAL, (iSelection == IDM_PASTE) ? CF_UNICODETEXT : 0, 0);
break;
case IDM_QUOTE:
- SendMessage(m_hwnd, WM_COMMAND, IDC_QUOTE, 0);
+ m_btnQuote.Click();
break;
case IDM_SELECTALL:
pCtrl.SendMsg(EM_EXSETSEL, 0, (LPARAM)& all);
|