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 /src/mir_core | |
parent | dc2a4dc50d6cc3e7bd513122756dd39141d7887e (diff) |
more clipboard shit removed
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/Windows/winutil.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mir_core/src/Windows/winutil.cpp b/src/mir_core/src/Windows/winutil.cpp index 27dec01400..f9c0fb18d6 100644 --- a/src/mir_core/src/Windows/winutil.cpp +++ b/src/mir_core/src/Windows/winutil.cpp @@ -139,16 +139,19 @@ MIR_CORE_DLL(int) Utils_CorrectFontSize(int size) MIR_CORE_DLL(void) Utils_ClipboardCopy(const wchar_t *pwszText) { size_t cbLen = mir_wstrlen(pwszText); - if (!::OpenClipboard(nullptr) || !cbLen) + if (!cbLen) + return; + + if (!OpenClipboard(nullptr)) return; - ::EmptyClipboard(); + EmptyClipboard(); HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (cbLen+1) * sizeof(wchar_t)); if (hData) { - mir_wstrcpy((wchar_t *)::GlobalLock(hData), pwszText); - ::GlobalUnlock(hData); - ::SetClipboardData(CF_UNICODETEXT, hData); + mir_wstrcpy((wchar_t *)GlobalLock(hData), pwszText); + GlobalUnlock(hData); + SetClipboardData(CF_UNICODETEXT, hData); } - ::CloseClipboard(); + CloseClipboard(); } |