diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-07-11 03:15:58 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2015-07-11 03:15:58 +0000 |
commit | 3e4099c9af8c63db18c03fa6f5ae6fef1b5d2777 (patch) | |
tree | 8c9a4763fdcc70a5fda9bfcdf8b6a292cb711023 /plugins/HistoryLinkListPlus | |
parent | bf4ae174716355279cb4f56c396bd436953215e6 (diff) |
LinkList: fix copy link to clipboard
git-svn-id: http://svn.miranda-ng.org/main/trunk@14532 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HistoryLinkListPlus')
-rw-r--r-- | plugins/HistoryLinkListPlus/src/linklist_dlg.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp index 9af1f8dd17..018c56cae3 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp @@ -142,7 +142,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) if (mouseEvent == 0x01)
EnableMenuItem(hSubMenu, IDM_SHOWMESSAGE, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
TranslateMenu(hSubMenu);
- link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 2) * sizeof(TCHAR));
+ link = (LPTSTR)mir_alloc((pENLink->chrg.cpMax - pENLink->chrg.cpMin + 4) * sizeof(TCHAR));
if (link == NULL)
break;
SendDlgItemMessage(hDlg, IDC_MAIN, EM_EXSETSEL, 0, (LPARAM)&pENLink->chrg);
@@ -166,17 +166,15 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) Utils_OpenUrlT(link);
break;
case IDM_LINK_COPY: {
- size_t dataLen;
- HGLOBAL hData;
if (!OpenClipboard(hDlg))
break;
EmptyClipboard();
- dataLen = (mir_tstrlen(link) + 1) * sizeof(TCHAR);
- hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
- _tcscpy_s((LPTSTR)GlobalLock(hData), dataLen / 2, link);
+ size_t dataLen = ((mir_tstrlen(link) + 1) * sizeof(TCHAR));
+ HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
+ memcpy((LPTSTR)GlobalLock(hData), link, dataLen);
GlobalUnlock(hData);
- SetClipboardData(CF_TEXT, hData);
+ SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
} break;
case IDM_SHOWMESSAGE:
|