diff options
author | Yuqian Yang <crupest@crupest.life> | 2025-09-07 11:46:11 +0800 |
---|---|---|
committer | Yuqian Yang <crupest@crupest.life> | 2025-09-07 11:46:11 +0800 |
commit | a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c (patch) | |
tree | b97687f99055b04775b63b7bafd2c909a7074cdb /src/platform/gui/win/Clipboard.cpp | |
parent | 20123151d12a0b01453ab6a36c84e4d3e5ea9504 (diff) | |
download | cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.gz cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.tar.bz2 cru-a0403d95bea3e3a3eaedf71a0d9c6d4e1316bd8c.zip |
Use std::string in logger.
Diffstat (limited to 'src/platform/gui/win/Clipboard.cpp')
-rw-r--r-- | src/platform/gui/win/Clipboard.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/platform/gui/win/Clipboard.cpp b/src/platform/gui/win/Clipboard.cpp index 9e305d1c..5525cb40 100644 --- a/src/platform/gui/win/Clipboard.cpp +++ b/src/platform/gui/win/Clipboard.cpp @@ -13,25 +13,25 @@ String WinClipboard::GetText() { auto god_window = application_->GetGodWindow(); if (!::OpenClipboard(god_window->GetHandle())) { - CRU_LOG_TAG_WARN(u"Failed to open clipboard."); + CRU_LOG_TAG_WARN("Failed to open clipboard."); return {}; } if (!::IsClipboardFormatAvailable(CF_UNICODETEXT)) { - CRU_LOG_TAG_WARN(u"Clipboard format for text is not available."); + CRU_LOG_TAG_WARN("Clipboard format for text is not available."); return {}; } auto handle = ::GetClipboardData(CF_UNICODETEXT); if (handle == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to get clipboard data."); + CRU_LOG_TAG_WARN("Failed to get clipboard data."); return {}; } auto ptr = ::GlobalLock(handle); if (ptr == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to lock clipboard data."); + CRU_LOG_TAG_WARN("Failed to lock clipboard data."); ::CloseClipboard(); return {}; } @@ -48,21 +48,21 @@ void WinClipboard::SetText(String text) { auto god_window = application_->GetGodWindow(); if (!::OpenClipboard(god_window->GetHandle())) { - CRU_LOG_TAG_WARN(u"Failed to open clipboard."); + CRU_LOG_TAG_WARN("Failed to open clipboard."); return; } auto handle = GlobalAlloc(GMEM_MOVEABLE, (text.size() + 1) * sizeof(wchar_t)); if (handle == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to allocate clipboard data."); + CRU_LOG_TAG_WARN("Failed to allocate clipboard data."); ::CloseClipboard(); return; } auto ptr = ::GlobalLock(handle); if (ptr == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to lock clipboard data."); + CRU_LOG_TAG_WARN("Failed to lock clipboard data."); ::GlobalFree(handle); ::CloseClipboard(); return; @@ -73,7 +73,7 @@ void WinClipboard::SetText(String text) { ::GlobalUnlock(handle); if (::SetClipboardData(CF_UNICODETEXT, handle) == nullptr) { - CRU_LOG_TAG_WARN(u"Failed to set clipboard data."); + CRU_LOG_TAG_WARN("Failed to set clipboard data."); } ::CloseClipboard(); |