diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-13 14:47:43 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-13 14:47:43 +0300 |
commit | 1d91debf07bc12ba6b2dc242e0984b07c46cda4e (patch) | |
tree | 222a084012373fac008337be774cecc6ddf79e38 | |
parent | 42cd18e516e0b4a33b53066173c42421d7afaf69 (diff) |
fixes #2210 (TabSRMM: crash on Quote button)
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 23 | ||||
-rw-r--r-- | plugins/TabSRMM/src/version.h | 2 |
2 files changed, 15 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index af564e8b6f..5b80be58eb 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -947,9 +947,20 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) if (hDBEvent == 0)
return;
- CHARRANGE sel;
- LOG()->WndProc(EM_EXGETSEL, 0, (LPARAM)&sel);
- if (sel.cpMin == sel.cpMax) {
+ bool bUseSelection = false;
+ if (m_iLogMode == 0) {
+ CHARRANGE sel;
+ LOG()->WndProc(EM_EXGETSEL, 0, (LPARAM)&sel);
+ if (sel.cpMin != sel.cpMax) {
+ ptrA szFromStream(LOG()->GetRichTextRtf(true, true));
+ ptrW converted(mir_utf8decodeW(szFromStream));
+ Utils::FilterEventMarkers(converted);
+ m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, ptrW(QuoteText(converted)));
+ bUseSelection = true;
+ }
+ }
+
+ if (!bUseSelection) {
DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDBEvent);
wchar_t *szText = (wchar_t*)mir_alloc((dbei.cbBlob + 1) * sizeof(wchar_t)); // URLs are made one char bigger for crlf
@@ -991,12 +1002,6 @@ void CMsgDialog::onClick_Quote(CCtrlButton*) if (bNeedsFree)
mir_free(szConverted);
}
- else {
- ptrA szFromStream(LOG()->GetRichTextRtf(true, true));
- ptrW converted(mir_utf8decodeW(szFromStream));
- Utils::FilterEventMarkers(converted);
- m_message.SendMsg(EM_SETTEXTEX, (WPARAM)&stx, ptrW(QuoteText(converted)));
- }
SetFocus(m_message.GetHwnd());
}
diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index da35591b32..fd58768343 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3
#define __MINOR_VERSION 6
#define __RELEASE_NUM 0
-#define __BUILD_NUM 4
+#define __BUILD_NUM 5
#include <stdver.h>
|