From 80a0da76eb4d30ffb40374587b3d675052edfc64 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 27 Apr 2015 02:31:04 +0000 Subject: TabSRMM: Wine fix for copy text from send area/message log git-svn-id: http://svn.miranda-ng.org/main/trunk@13186 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/generic_msghandlers.cpp | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'plugins/TabSRMM/src/generic_msghandlers.cpp') diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 8d4caea25c..8fcb10d750 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1094,32 +1094,17 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM, LPARAM lParam) ///////////////////////////////////////////////////////////////////////////////////////// // 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 TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT result = mir_callNextSubclass(hwnd, oldWndProc, msg, wParam, lParam); - if (!OpenClipboard(hwnd)) - return result; - HANDLE hClip = GetClipboardData(CF_UNICODETEXT); - if (!hClip) - goto err_out; - TCHAR *tszText = (TCHAR*)mir_alloc((mir_tstrlen((TCHAR*)hClip) + 2) * sizeof(TCHAR)); - if (!tszText) - goto err_out; - mir_tstrcpy(tszText, (TCHAR*)hClip); - Utils::FilterEventMarkers(tszText); - EmptyClipboard(); - - HGLOBAL hgbl = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tszText) + 1) * sizeof(TCHAR)); - TCHAR *tszLocked = (TCHAR*)GlobalLock(hgbl); - mir_tstrcpy(tszLocked, tszText); - GlobalUnlock(hgbl); - SetClipboardData(CF_UNICODETEXT, hgbl); - mir_free(tszText); - -err_out: - CloseClipboard(); + ptrA szFromStream(Message_GetFromStream(hwnd, SF_TEXT | SFF_SELECTION)); + ptrW converted(mir_utf8decodeW(szFromStream)); + + Utils::FilterEventMarkers(converted); + Utils::CopyToClipBoard(converted, hwnd); + return result; } -- cgit v1.2.3