|
|
@ -168,7 +168,7 @@ bool CSystemUtils::copyTextToClipboard(const ucstring &text)
|
|
|
|
|
|
|
|
|
|
|
|
// allocates a buffer to copy text in global memory
|
|
|
|
// allocates a buffer to copy text in global memory
|
|
|
|
std::string textLocal;
|
|
|
|
std::string textLocal;
|
|
|
|
if (!isUnicode) textLocal = NLMISC::wideToMbcs(text);
|
|
|
|
if (!isUnicode) textLocal = NLMISC::wideToMbcs((const wchar_t *)text.c_str(), text.size());
|
|
|
|
if (text.size() && !textLocal.size()) textLocal = text.toString();
|
|
|
|
if (text.size() && !textLocal.size()) textLocal = text.toString();
|
|
|
|
HGLOBAL mem = GlobalAlloc(GHND | GMEM_DDESHARE, isUnicode ? ((text.size() + 1) * sizeof(wchar_t)) : textLocal.size());
|
|
|
|
HGLOBAL mem = GlobalAlloc(GHND | GMEM_DDESHARE, isUnicode ? ((text.size() + 1) * sizeof(wchar_t)) : textLocal.size());
|
|
|
|
|
|
|
|
|
|
|
@ -232,7 +232,7 @@ bool CSystemUtils::pasteTextFromClipboard(ucstring &text)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static_cast<std::wstring &>(text) = NLMISC::mbcsToWide((const char *)hLock);
|
|
|
|
reinterpret_cast<std::wstring &>(text) = NLMISC::mbcsToWide((const char *)hLock);
|
|
|
|
if (!text.size() && ((const char *)hLock)[0])
|
|
|
|
if (!text.size() && ((const char *)hLock)[0])
|
|
|
|
text = (const char *)hLock;
|
|
|
|
text = (const char *)hLock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|