diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-16 17:42:08 +0000 |
commit | 5975b2d0903bd5df128d55e20cd27d7c13b4e46c (patch) | |
tree | 6696492511c591fa8bf3b65a64864245caa3e7c2 /plugins/ChangeKeyboardLayout/text_operations.c | |
parent | 8617d7e00546f892c9084f7c382648b23d8bbb63 (diff) |
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@448 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ChangeKeyboardLayout/text_operations.c')
-rw-r--r-- | plugins/ChangeKeyboardLayout/text_operations.c | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/plugins/ChangeKeyboardLayout/text_operations.c b/plugins/ChangeKeyboardLayout/text_operations.c index 8118d76afa..c7652c7776 100644 --- a/plugins/ChangeKeyboardLayout/text_operations.c +++ b/plugins/ChangeKeyboardLayout/text_operations.c @@ -14,9 +14,9 @@ static DWORD CALLBACK EditStreamOutRtf(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG c CopyMemory(esd->pbBuff+esd->iCurrent, pbBuff, cb);
esd->iCurrent += cb;
esd->pbBuff[esd->iCurrent] = 0;
- #if defined (_UNICODE)
+
esd->pbBuff[esd->iCurrent+1] = 0;
- #endif
+
*pcb = cb;
return 0;
}
@@ -56,11 +56,9 @@ BOOL CopyTextToClipboard(LPTSTR ptszText) _tcscpy((TCHAR*)GlobalLock(hCopy), ptszText);
GlobalUnlock(hCopy);
- #if defined (_UNICODE)
+
SetClipboardData(CF_UNICODETEXT, hCopy);
- #else
- SetClipboardData(CF_TEXT, hCopy);
- #endif
+
CloseClipboard();
return TRUE;
@@ -129,15 +127,11 @@ LPTSTR GenerateLayoutString(HKL hklLayout) shVirtualKey = MapVirtualKeyEx(iScanCode, 1, hklLayout);
bState[shVirtualKey&0x00FF] = 0x80;
- #if defined (_UNICODE)
+
iRes = ToUnicodeEx(shVirtualKey, iScanCode, bState, ptszTemp, 3, 0, hklLayout);
// Защита от дэд-кеев
if (iRes<0) ToUnicodeEx(shVirtualKey, iScanCode, bState, ptszTemp, 3, 0, hklLayout);
- #else
- iRes = ToAsciiEx(shVirtualKey, iScanCode, bState, ptszTemp, 0, hklLayout);
- // Защита от дэд-кеев
- if (iRes<0) ToAsciiEx(shVirtualKey, iScanCode, bState, ptszTemp, 0, hklLayout);
- #endif
+
//Если нам вернули нулевой символ, или не вернули ничего, то присвоим "звоночек"
if (ptszTemp[0] == 0) ptszLayStr[i] = 3; else ptszLayStr[i] = ptszTemp[0];
@@ -302,9 +296,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) ieEvent.dwFlags = 0;
ieEvent.iType = IEE_GET_SELECTION;
//event.codepage = 1200;
- #if !defined(_UNICODE)
- ieEvent.dwFlags |= IEEF_NO_UNICODE;
- #endif
+
if (ServiceExists(MS_HPP_EG_EVENT))
{
@@ -361,11 +353,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) if (WindowType == WTYPE_RichEdit)
{
ZeroMemory(&esdData, sizeof(esdData));
- #if defined (_UNICODE)
+
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SF_UNICODE|SFF_SELECTION, (LPARAM)&esStream)>0)
- #else
- if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SFF_SELECTION, (LPARAM)&esStream)>0)
- #endif
+
ptszInText = GeTStringFromStreamData(&esdData);
else
{
@@ -405,11 +395,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) crTemp.cpMin = 0;
crTemp.cpMax = -1;
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crTemp);
- #if defined (_UNICODE)
+
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SF_UNICODE|SFF_SELECTION, (LPARAM)&esStream) != 0)
- #else
- if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SFF_SELECTION, (LPARAM)&esStream) != 0)
- #endif
+
ptszInText = GeTStringFromStreamData(&esdData);
else
{
@@ -450,11 +438,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) {
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crTemp);
ZeroMemory(&esdData, sizeof(esdData));
- #if defined (_UNICODE)
+
if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SF_UNICODE|SFF_SELECTION, (LPARAM)&esStream) != 0)
- #else
- if (SendMessage(hTextWnd, EM_STREAMOUT, SF_TEXT|SFF_SELECTION, (LPARAM)&esStream) != 0)
- #endif
+
ptszInText = GeTStringFromStreamData(&esdData);
else
{
|