From c6f59d75142b7568dd89f5cff691b0b58030aafd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Sep 2023 13:41:55 +0300 Subject: SmileyAdd: fix for the obsolete quirks in SmaileyAdd API --- plugins/TranslitSwitcher/src/Layoutproc.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'plugins/TranslitSwitcher/src') diff --git a/plugins/TranslitSwitcher/src/Layoutproc.cpp b/plugins/TranslitSwitcher/src/Layoutproc.cpp index 5ac0ba1115..33183d9615 100644 --- a/plugins/TranslitSwitcher/src/Layoutproc.cpp +++ b/plugins/TranslitSwitcher/src/Layoutproc.cpp @@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. #include "stdafx.h" -SMADD_BATCHPARSE2 smgp; +SMADD_BATCHPARSE smgp; SMADD_BATCHPARSERES *smileyPrs = nullptr; bool isItSmiley(unsigned int position) @@ -399,9 +399,8 @@ void SwitchLayout(bool lastword) if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) { memset(&smgp, 0, sizeof(smgp)); - smgp.cbSize = sizeof(smgp); - smgp.str = buf; - smgp.flag = SAFL_TCHAR; + smgp.str.w = buf; + smgp.flag = SAFL_UNICODE; smileyPrs = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smgp); } @@ -449,9 +448,8 @@ void SwitchLayout(bool lastword) if (slen != 0) { if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) { memset(&smgp, 0, sizeof(smgp)); - smgp.cbSize = sizeof(smgp); - smgp.str = sel; - smgp.flag = SAFL_TCHAR; + smgp.str.w = sel; + smgp.flag = SAFL_UNICODE; smileyPrs = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smgp); } @@ -672,9 +670,8 @@ int OnButtonPressed(WPARAM, LPARAM lParam) HKL hkl = GetKeyboardLayout(dwThreadID); memset(&smgp, 0, sizeof(smgp)); - smgp.cbSize = sizeof(smgp); - smgp.str = sel; - smgp.flag = SAFL_TCHAR; + smgp.str.w = sel; + smgp.flag = SAFL_UNICODE; if (ServiceExists(MS_SMILEYADD_BATCHPARSE)) smileyPrs = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&smgp); -- cgit v1.2.3