From c5dc28ec2272a865ef2f28fd7ab151b55517fedf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Sep 2022 19:16:12 +0300 Subject: more clipboard shit removed --- plugins/MirOTR/src/options.cpp | 4 ++-- plugins/MirOTR/src/utils.cpp | 17 ----------------- plugins/MirOTR/src/utils.h | 2 -- 3 files changed, 2 insertions(+), 21 deletions(-) (limited to 'plugins/MirOTR/src') diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 9c557c2266..6236df3f6c 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -410,7 +410,7 @@ public: if (proto) { char fprint[45]; if (otrl_privkey_fingerprint(otr_user_state, fprint, proto, proto)) - CopyToClipboard(_A2T(fprint)); + Utils_ClipboardCopy(_A2T(fprint)); } break; @@ -795,7 +795,7 @@ public: case IDM_OPT_COPY: wchar_t hash[45]; otrl_privkey_hash_to_humanT(hash, fp->fingerprint); - CopyToClipboard(hash); + Utils_ClipboardCopy(hash); break; case IDM_OPT_FINGER_FORGET: diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 186a37364f..76b4d03c96 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -187,23 +187,6 @@ void ShowError(wchar_t *msg) } } -void CopyToClipboard(const wchar_t *pwszMsg) -{ - if (pwszMsg == nullptr) - return; - - HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_wstrlen(pwszMsg) + 1) * sizeof(wchar_t)); - LPWSTR lptstrCopy = (LPWSTR)GlobalLock(hglbCopy); - mir_wstrcpy(lptstrCopy, pwszMsg); - GlobalUnlock(hglbCopy); - - if (OpenClipboard(nullptr)) { - EmptyClipboard(); - SetClipboardData(CF_UNICODETEXT, hglbCopy); - CloseClipboard(); - } -} - void ShowPopupUtf(const char* line1, const char* line2, int timeout, const MCONTACT hContact) { wchar_t* l1 = (line1) ? mir_utf8decodeW(line1) : nullptr; diff --git a/plugins/MirOTR/src/utils.h b/plugins/MirOTR/src/utils.h index 1bef577c29..17dc74d758 100644 --- a/plugins/MirOTR/src/utils.h +++ b/plugins/MirOTR/src/utils.h @@ -24,8 +24,6 @@ extern __inline const wchar_t* contact_get_nameT(MCONTACT hContact); wchar_t* ProtoGetNickname(const char* proto); -void CopyToClipboard(const wchar_t *pwszMsg); - char* GetDlgItemTextUtf(HWND hwndDlg, int ctrlId); void ShowPopup(const wchar_t* line1, const wchar_t* line2, int timeout, const MCONTACT hContact = NULL); -- cgit v1.2.3