Skip to content

Commit

Permalink
1.8.4
Browse files Browse the repository at this point in the history
・センターバーを含む候補または注釈を登録したときスラッシュまたはセミコロンも含んでいると
 センターバーの前にバックスラッシュが付加されてしまうバグを修正しました。

・SKK辞書サーバーの文字コードとしてEUC-JIS-2004を設定している場合、UTF-16から変換できない文字が見出し語に含まれているとその直前までの文字列で辞書検索してしまっていたので、このときはSKK辞書サーバーでの検索自体を行わないようにしました。

・テキストサービスの終了処理のエラーチェックを追加しました。
 ・murachueさん、情報ありがとうございます。
  • Loading branch information
nathancorvussolis committed Feb 7, 2015
1 parent ec61014 commit 6c4de7e
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 25 deletions.
4 changes: 2 additions & 2 deletions common/parseskkdic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
Expand Down Expand Up @@ -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);

Expand Down
6 changes: 3 additions & 3 deletions common/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion imcrvmgr/SearchCharacter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
17 changes: 12 additions & 5 deletions imcrvmgr/SearchSKKServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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));
Expand Down Expand Up @@ -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("/[^/]+");
Expand All @@ -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());
}
Expand Down
5 changes: 0 additions & 5 deletions imcrvtip/KeyHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -532,11 +532,6 @@ void CTextService::_ResetStatus()

void CTextService::_GetActiveFlags()
{
if(_pThreadMgr == NULL)
{
return;
}

_dwActiveFlags = 0;
_ImmersiveMode = FALSE;
_UILessMode = FALSE;
Expand Down
2 changes: 1 addition & 1 deletion imcrvtip/TextEditSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
12 changes: 10 additions & 2 deletions imcrvtip/TextService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ CTextService::CTextService()
_cRef = 1;

_pThreadMgr = NULL;
_ClientId = TF_CLIENTID_NULL;
_dwThreadMgrEventSinkCookie = TF_INVALID_COOKIE;
_dwThreadFocusSinkCookie = TF_INVALID_COOKIE;
_dwCompartmentEventSinkOpenCloseCookie = TF_INVALID_COOKIE;
_dwCompartmentEventSinkInputmodeConversionCookie = TF_INVALID_COOKIE;
_pTextEditSinkContext = NULL;
_dwTextEditSinkCookie = TF_INVALID_COOKIE;
_pComposition = NULL;
_pLangBarItem = NULL;
_pLangBarItemI = NULL;
_pCandidateList = NULL;
_pInputModeWindow = NULL;

Expand Down Expand Up @@ -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);
Expand All @@ -236,10 +244,10 @@ STDAPI CTextService::Deactivate()

_UninitThreadMgrEventSink();

SafeRelease(&_pThreadMgr);

_UninitFont();

SafeRelease(&_pThreadMgr);

_ClientId = TF_CLIENTID_NULL;

return S_OK;
Expand Down
4 changes: 2 additions & 2 deletions installer/README.TXT
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

==============================================================================
CorvusSKK version 1.8.3
CorvusSKK version 1.8.4

https://code.google.com/p/corvus-skk/
[email protected]
Expand Down Expand Up @@ -620,6 +620,6 @@
・開発環境

Visual Studio Express 2013 for Windows Desktop Update 4
WiX Toolset v3.9
WiX Toolset v3.9 R2

==============================================================================
4 changes: 2 additions & 2 deletions installer/corvusskk-x64.wxs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?define version="1.8.3" ?>
<Product Id="*" Name="CorvusSKK" Language="1033" Version="$(var.version)" Manufacturer="CorvusSKK Project" UpgradeCode="DBDB315C-1F74-4051-8A67-705D0FD16497">
<?define version="1.8.4" ?>
<Product Id="*" Name="CorvusSKK" Language="1033" Version="$(var.version)" Manufacturer="nathancorvussolis" UpgradeCode="DBDB315C-1F74-4051-8A67-705D0FD16497">

<Package Id="*" Compressed="yes" Description="CorvusSKK" Comments="version $(var.version)" Platform="x64" InstallerVersion="405" InstallScope="perMachine" InstallPrivileges="elevated" />
<Media Id="1" Cabinet="corvusskk.cab" CompressionLevel="high" EmbedCab="yes" />
Expand Down
4 changes: 2 additions & 2 deletions installer/corvusskk-x86.wxs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?define version="1.8.3" ?>
<Product Id="*" Name="CorvusSKK" Language="1033" Version="$(var.version)" Manufacturer="CorvusSKK Project" UpgradeCode="3F1244EC-9A5C-4041-9A33-E26B03C63C9B">
<?define version="1.8.4" ?>
<Product Id="*" Name="CorvusSKK" Language="1033" Version="$(var.version)" Manufacturer="nathancorvussolis" UpgradeCode="3F1244EC-9A5C-4041-9A33-E26B03C63C9B">

<Package Id="*" Compressed="yes" Description="CorvusSKK" Comments="version $(var.version)" Platform="x86" InstallerVersion="405" InstallScope="perMachine" InstallPrivileges="elevated" />
<Media Id="1" Cabinet="corvusskk.cab" CompressionLevel="high" EmbedCab="yes" />
Expand Down

0 comments on commit 6c4de7e

Please sign in to comment.