diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-21 16:11:58 +0000 |
commit | 48266e479d1fcf5153b29c612866845990fccad8 (patch) | |
tree | c8cbc908cd3c5f08731e5e8d7eaac6b568007d09 /plugins/CyrTranslit | |
parent | ebdb556f152734035846f120eb8112f88ef91281 (diff) |
war against atavisms continues
- everything that goes to PSS_MESSAGE should be sent as utf8 string;
- thus PREF_UNICODE & PREF_UTF support discontinued, these constants are removed;
- support for PREF_UNICODE & PREF_UTF in protocols also removed;
- PREF_UNICODE used in file transfers (PROTOFILERECVT) replaced with PRFF_UNICODE / PRFF_TCHAR
git-svn-id: http://svn.miranda-ng.org/main/trunk@13734 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CyrTranslit')
-rw-r--r-- | plugins/CyrTranslit/src/TransliterationProtocol.cpp | 41 | ||||
-rw-r--r-- | plugins/CyrTranslit/src/TransliterationProtocol.h | 2 |
2 files changed, 1 insertions, 42 deletions
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.cpp b/plugins/CyrTranslit/src/TransliterationProtocol.cpp index c4d6649f2c..ebb544ffd1 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.cpp +++ b/plugins/CyrTranslit/src/TransliterationProtocol.cpp @@ -55,40 +55,6 @@ void TransliterationProtocol::TranslateMessageUTF(WPARAM, LPARAM lParam) strcpy(reinterpret_cast<char*>(ccs->lParam), txtUTF.c_str());
}
-void TransliterationProtocol::TranslateMessageW(WPARAM, LPARAM lParam)
-{
- CCSDATA *ccs = reinterpret_cast<CCSDATA*>(lParam);
-
- std::string txtA = reinterpret_cast<const char*>(ccs->lParam);
- int txtAlen = (int)(sizeof(txtA[0]) * (txtA.length() + 1));
- txtA = TransliterationMap::getInstance().cyrillicToLatin(txtA);
-
- std::wstring txtW = reinterpret_cast<const wchar_t*>(ccs->lParam + txtAlen);
- txtW = TransliterationMap::getInstance().cyrillicToLatin(txtW);
-
- txtAlen = (int)(sizeof(txtA[0]) * (txtA.length() + 1));
- const DWORD newSize = static_cast<DWORD>(txtAlen + (sizeof(txtW[0]) * (txtW.length() + 1)));
-
- ccs->lParam = reinterpret_cast<LPARAM>(mir_alloc(newSize));
-
- strcpy(reinterpret_cast<char*>(ccs->lParam), txtA.c_str());
- wcscpy(reinterpret_cast<wchar_t*>(ccs->lParam + txtAlen), txtW.c_str());
-}
-
-void TransliterationProtocol::TranslateMessageA(WPARAM, LPARAM lParam)
-{
- CCSDATA *ccs = reinterpret_cast<CCSDATA*>(lParam);
-
- std::string txt = reinterpret_cast<const char*>(ccs->lParam);
- txt = TransliterationMap::getInstance().cyrillicToLatin(txt);
-
- const DWORD newSize = static_cast<DWORD>(txt.length() + 1);
-
- ccs->lParam = reinterpret_cast<LPARAM>(mir_alloc(newSize));
-
- strcpy(reinterpret_cast<char*>(ccs->lParam), txt.c_str());
-}
-
//------------------------------------------------------------------------------
INT_PTR TransliterationProtocol::sendMessage(WPARAM wParam, LPARAM lParam)
@@ -100,12 +66,7 @@ INT_PTR TransliterationProtocol::sendMessage(WPARAM wParam, LPARAM lParam) LPARAM oldlParam = ccs->lParam;
bool msgProcessed = true;
- if (ccs->wParam & PREF_UTF)
- TranslateMessageUTF(wParam, lParam);
- else if (ccs->wParam & PREF_UNICODE)
- TranslateMessageW(wParam, lParam);
- else
- TranslateMessageA(wParam, lParam);
+ TranslateMessageUTF(wParam, lParam);
int ret = CallService(MS_PROTO_CHAINSEND, wParam, lParam);
diff --git a/plugins/CyrTranslit/src/TransliterationProtocol.h b/plugins/CyrTranslit/src/TransliterationProtocol.h index 08cb715447..cf86d183bc 100644 --- a/plugins/CyrTranslit/src/TransliterationProtocol.h +++ b/plugins/CyrTranslit/src/TransliterationProtocol.h @@ -46,8 +46,6 @@ public: */
static INT_PTR sendMessage(WPARAM wParam, LPARAM lParam);
- static void TranslateMessageA(WPARAM wParam, LPARAM lParam);
- static void TranslateMessageW(WPARAM wParam, LPARAM lParam);
static void TranslateMessageUTF(WPARAM wParam, LPARAM lParam);
private:
|