diff options
author | George Hazan <ghazan@miranda.im> | 2022-09-26 19:16:12 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-09-26 19:16:12 +0300 |
commit | c5dc28ec2272a865ef2f28fd7ab151b55517fedf (patch) | |
tree | d751f3e869c66371b8f1d65480b39c2997ba6e62 /plugins/MirOTR/src | |
parent | dc2a4dc50d6cc3e7bd513122756dd39141d7887e (diff) |
more clipboard shit removed
Diffstat (limited to 'plugins/MirOTR/src')
-rw-r--r-- | plugins/MirOTR/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/src/utils.cpp | 17 | ||||
-rw-r--r-- | plugins/MirOTR/src/utils.h | 2 |
3 files changed, 2 insertions, 21 deletions
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); |