diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-04-27 02:31:04 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-04-27 02:31:04 +0000 |
commit | 80a0da76eb4d30ffb40374587b3d675052edfc64 (patch) | |
tree | 97359977c4633683ed99b86feaadb206308c1380 /plugins/TabSRMM/src/generic_msghandlers.cpp | |
parent | 1f86fa0270660bd28e1bea80527dcbf37af1313b (diff) |
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
Diffstat (limited to 'plugins/TabSRMM/src/generic_msghandlers.cpp')
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 29 |
1 files changed, 7 insertions, 22 deletions
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; } |