diff options
author | George Hazan <ghazan@miranda.im> | 2017-04-05 20:18:35 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-04-05 20:18:35 +0300 |
commit | 6b3d56dbdccc4b608d258a4a7705514e46947e28 (patch) | |
tree | da2167bc274694a25cdd204370062360ad3048a9 /plugins/TabSRMM/src/msgdlgutils.cpp | |
parent | c1ceb16e6e5957c94232a0ff43fbeca0ff19bf93 (diff) |
SRMM* plugins switched to CCtrlRichEdit
Diffstat (limited to 'plugins/TabSRMM/src/msgdlgutils.cpp')
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index a00131b43c..a05ad3a6f1 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -786,29 +786,6 @@ void CTabBaseDlg::FlashOnClist(MEVENT hEvent, DBEVENTINFO *dbei) }
/////////////////////////////////////////////////////////////////////////////////////////
-// retrieve contents of the richedit control by streaming.Used to get the
-// typed message before sending it.
-// caller must mir_free the returned pointer.
-// UNICODE version returns UTF-8 encoded string.
-
-char* TSAPI Message_GetFromStream(HWND hwndRtf, DWORD dwPassedFlags)
-{
- if (hwndRtf == 0)
- return nullptr;
-
- DWORD dwFlags = (CP_UTF8 << 16) | SF_USECODEPAGE;
- if (dwPassedFlags == 0)
- dwFlags |= (SF_RTFNOOBJS | SFF_PLAINRTF);
- else
- dwFlags |= dwPassedFlags;
-
- char *pszText = nullptr;
- EDITSTREAM stream = { 0 };
- stream.pfnCallback = Srmm_MessageStreamCallback;
- stream.dwCookie = (DWORD_PTR)&pszText; // pass pointer to pointer
- SendMessage(hwndRtf, EM_STREAMOUT, dwFlags, (LPARAM)&stream);
- return pszText; // pszText contains the text
-}
static wchar_t tszRtfBreaks[] = L" \\\n\r";
@@ -1703,6 +1680,27 @@ void CTabBaseDlg::KbdState(bool &isShift, bool &isControl, bool &isAlt) }
/////////////////////////////////////////////////////////////////////////////////////////
+// generic handler for the WM_COPY message in message log/chat history richedit control(s).
+// it filters out the invisible event boundary markers from the text copied to the clipboard.
+// WINE Fix: overwrite clippboad data from original control data
+
+LRESULT CTabBaseDlg::WMCopyHandler(UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT result = mir_callNextSubclass(m_log.GetHwnd(), stubLogProc, msg, wParam, lParam);
+
+ ptrA szFromStream(m_log.GetRichTextRtf(true, true));
+ if (szFromStream != nullptr) {
+ ptrW converted(mir_utf8decodeW(szFromStream));
+ if (converted != nullptr) {
+ Utils::FilterEventMarkers(converted);
+ Utils::CopyToClipBoard(converted, m_log.GetHwnd());
+ }
+ }
+
+ return result;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// calculate the minimum required client height for the given message
// window layout
//
|