diff --git a/common/parseskkdic.cpp b/common/parseskkdic.cpp index 5d5fcf87..d35b1e33 100644 --- a/common/parseskkdic.cpp +++ b/common/parseskkdic.cpp @@ -212,7 +212,7 @@ std::wstring ParseConcat(const std::wstring &s) re.assign(L"\\(concat \"(.+)\"\\)"); tmpstr = std::regex_replace(tmpstr, re, fmt); - re.assign(L"\\\\([\\\"|\\\\])"); + re.assign(L"\\\\([\\\"\\\\])"); tmpstr = std::regex_replace(tmpstr, re, fmt); re.assign(L"\\\\[0-3][0-7]{2}"); @@ -246,7 +246,7 @@ std::wstring MakeConcat(const std::wstring &s) if(std::regex_search(ret, re)) { // "\"" -> "\\\"", "\\" -> "\\\\" - re.assign(L"([\\\"|\\\\])"); + re.assign(L"([\\\"\\\\])"); fmt.assign(L"\\$1"); ret = std::regex_replace(ret, re, fmt); diff --git a/common/version.h b/common/version.h index 4d94695f..1d424462 100644 --- a/common/version.h +++ b/common/version.h @@ -3,7 +3,7 @@ #define VERSION_H #define TEXTSERVICE_NAME L"CorvusSKK" -#define TEXTSERVICE_VER L"1.8.3" +#define TEXTSERVICE_VER L"1.8.4" #ifndef _DEBUG #define TEXTSERVICE_DESC TEXTSERVICE_NAME @@ -14,7 +14,7 @@ //for resource #define RC_AUTHOR "nathancorvussolis" #define RC_PRODUCT "CorvusSKK" -#define RC_VERSION "1.8.3" -#define RC_VERSION_D 1,8,3,0 +#define RC_VERSION "1.8.4" +#define RC_VERSION_D 1,8,4,0 #endif diff --git a/imcrvmgr/SearchCharacter.cpp b/imcrvmgr/SearchCharacter.cpp index 5c843f41..1ef34bb3 100644 --- a/imcrvmgr/SearchCharacter.cpp +++ b/imcrvmgr/SearchCharacter.cpp @@ -131,7 +131,7 @@ std::wstring SearchCharacterCode(const std::wstring &searchkey) CONST CHAR ss3 = 0x0F; //ASCII, JIS X 0201 (片仮名, 8bit), JIS X 0213 面区点番号 - len = -1; + len = (size_t)-1; if(WideCharToEucJis2004(searchkey.c_str(), NULL, NULL, &len)) { std::string euc = WCTOEUC(searchkey); diff --git a/imcrvmgr/SearchSKKServer.cpp b/imcrvmgr/SearchSKKServer.cpp index cb4fd80e..1b40c9ec 100644 --- a/imcrvmgr/SearchSKKServer.cpp +++ b/imcrvmgr/SearchSKKServer.cpp @@ -11,7 +11,7 @@ std::wstring SearchSKKServer(const std::wstring &searchkey) std::wstring candidate; std::string key; std::string buf; - size_t pidx; + size_t len, pidx; CHAR rbuf[RECVBUFSIZE]; int n; @@ -24,7 +24,15 @@ std::wstring SearchSKKServer(const std::wstring &searchkey) switch(encoding) { case 0: - key.append(wstring_to_eucjis2004_string(searchkey)); + len = (size_t)-1; + if(WideCharToEucJis2004(searchkey.c_str(), NULL, NULL, &len)) + { + key.append(wstring_to_eucjis2004_string(searchkey)); + } + else + { + return candidate; + } break; case 1: key.append(wstring_to_utf8_string(searchkey)); @@ -72,7 +80,6 @@ std::wstring SearchSKKServer(const std::wstring &searchkey) std::string s; std::smatch m; std::regex r; - size_t ds; s = buf.substr(1); r.assign("/[^/]+"); @@ -81,8 +88,8 @@ std::wstring SearchSKKServer(const std::wstring &searchkey) switch(encoding) { case 0: - ds = -1; - if(EucJis2004ToWideChar(m.str().c_str(), NULL, NULL, &ds)) + len = (size_t)-1; + if(EucJis2004ToWideChar(m.str().c_str(), NULL, NULL, &len)) { candidate += eucjis2004_string_to_wstring(m.str()); } diff --git a/imcrvtip/KeyHandler.cpp b/imcrvtip/KeyHandler.cpp index 9e613381..494f0000 100644 --- a/imcrvtip/KeyHandler.cpp +++ b/imcrvtip/KeyHandler.cpp @@ -532,11 +532,6 @@ void CTextService::_ResetStatus() void CTextService::_GetActiveFlags() { - if(_pThreadMgr == NULL) - { - return; - } - _dwActiveFlags = 0; _ImmersiveMode = FALSE; _UILessMode = FALSE; diff --git a/imcrvtip/TextEditSink.cpp b/imcrvtip/TextEditSink.cpp index 4dae293f..4c880815 100644 --- a/imcrvtip/TextEditSink.cpp +++ b/imcrvtip/TextEditSink.cpp @@ -46,7 +46,7 @@ BOOL CTextService::_InitTextEditSink(ITfDocumentMgr *pDocumentMgr) BOOL fRet; ITfSource *pSource; - if(_dwTextEditSinkCookie != TF_INVALID_COOKIE) + if(_pTextEditSinkContext != NULL && _dwTextEditSinkCookie != TF_INVALID_COOKIE) { if(_pTextEditSinkContext->QueryInterface(IID_PPV_ARGS(&pSource)) == S_OK) { diff --git a/imcrvtip/TextService.cpp b/imcrvtip/TextService.cpp index 95cfd0c5..c19820ea 100644 --- a/imcrvtip/TextService.cpp +++ b/imcrvtip/TextService.cpp @@ -11,6 +11,7 @@ CTextService::CTextService() _cRef = 1; _pThreadMgr = NULL; + _ClientId = TF_CLIENTID_NULL; _dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE; _dwThreadFocusSinkCookie = TF_INVALID_COOKIE; _dwCompartmentEventSinkOpenCloseCookie = TF_INVALID_COOKIE; @@ -18,6 +19,8 @@ CTextService::CTextService() _pTextEditSinkContext = NULL; _dwTextEditSinkCookie = TF_INVALID_COOKIE; _pComposition = NULL; + _pLangBarItem = NULL; + _pLangBarItemI = NULL; _pCandidateList = NULL; _pInputModeWindow = NULL; @@ -214,6 +217,11 @@ STDAPI CTextService::ActivateEx(ITfThreadMgr *ptim, TfClientId tid, DWORD dwFlag STDAPI CTextService::Deactivate() { + if(_pThreadMgr == NULL) + { + return S_OK; + } + _SaveUserDic(); SafeRelease(&_pCandidateList); @@ -236,10 +244,10 @@ STDAPI CTextService::Deactivate() _UninitThreadMgrEventSink(); - SafeRelease(&_pThreadMgr); - _UninitFont(); + SafeRelease(&_pThreadMgr); + _ClientId = TF_CLIENTID_NULL; return S_OK; diff --git a/installer/README.TXT b/installer/README.TXT index 3d5ee94b..faf9b6c3 100644 --- a/installer/README.TXT +++ b/installer/README.TXT @@ -1,6 +1,6 @@  ============================================================================== - CorvusSKK version 1.8.3 + CorvusSKK version 1.8.4 https://code.google.com/p/corvus-skk/ nathancorvussolis@gmail.com @@ -620,6 +620,6 @@ ・開発環境 Visual Studio Express 2013 for Windows Desktop Update 4 - WiX Toolset v3.9 + WiX Toolset v3.9 R2 ============================================================================== diff --git a/installer/corvusskk-x64.wxs b/installer/corvusskk-x64.wxs index 78f502f6..1d9280ca 100644 --- a/installer/corvusskk-x64.wxs +++ b/installer/corvusskk-x64.wxs @@ -1,8 +1,8 @@ - - + + diff --git a/installer/corvusskk-x86.wxs b/installer/corvusskk-x86.wxs index 39b5b7a9..655cfaf7 100644 --- a/installer/corvusskk-x86.wxs +++ b/installer/corvusskk-x86.wxs @@ -1,8 +1,8 @@ - - + +