From f02bc80c981bd56ec6eefbdebf6b3b6ec3182d45 Mon Sep 17 00:00:00 2001 From: nathancorvussolis Date: Sat, 5 Sep 2015 19:27:41 +0900 Subject: [PATCH] 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ・Microsoft Publisher 2013 のテキストボックスでの不具合を修正しました。  ・確定入力で入力開始直後のローマ字1字目が表示されるようにしました。  ・確定入力でローマ字が1字の仮名が入力されるようにしました。  ・NAKANO Takeoさん、情報ありがとうございます。 --- README.md | 2 +- common/version.h | 6 ++-- imcrvtip/KeyHandlerChar.cpp | 18 +++++++---- imcrvtip/KeyHandlerComposition.cpp | 50 +++++++++++++++++------------- imcrvtip/KeyHandlerControl.cpp | 12 ++++--- imcrvtip/KeyHandlerConv.cpp | 4 ++- imcrvtip/TextService.cpp | 1 - imcrvtip/TextService.h | 2 +- installer/README.TXT | 4 +-- installer/_version.cmd | 2 +- installer/corvusskk-x64.wxs | 2 +- installer/corvusskk-x86.wxs | 2 +- 12 files changed, 62 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index c3b8e1b6..da5fba11 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# CorvusSKK ver. 1.9.0 +# CorvusSKK ver. 1.9.1 Windowsで動作するSKK風のIMEです。 diff --git a/common/version.h b/common/version.h index e102531a..38c8905c 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.9.0" +#define TEXTSERVICE_VER L"1.9.1" #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.9.0" -#define RC_VERSION_D 1,9,0,0 +#define RC_VERSION "1.9.1" +#define RC_VERSION_D 1,9,1,0 #endif diff --git a/imcrvtip/KeyHandlerChar.cpp b/imcrvtip/KeyHandlerChar.cpp index 49980dc3..f024aff6 100644 --- a/imcrvtip/KeyHandlerChar.cpp +++ b/imcrvtip/KeyHandlerChar.cpp @@ -174,14 +174,16 @@ HRESULT CTextService::_HandleChar(TfEditCookie ec, ITfContext *pContext, WPARAM } else { - _HandleCharShift(ec, pContext); if(rkc.soku) { + _HandleCharShift(ec, pContext); roman.push_back(ch); _Update(ec, pContext); } else { + cursoridx = kana.size(); + _Update(ec, pContext, TRUE); _HandleCharReturn(ec, pContext); } } @@ -189,10 +191,10 @@ HRESULT CTextService::_HandleChar(TfEditCookie ec, ITfContext *pContext, WPARAM break; case E_PENDING: //途中まで一致 + _HandleCharShift(ec, pContext); + if(rkc.roman[0] != L'\0' && rkc.wait) //待機 { - _HandleCharShift(ec, pContext); - switch(inputmode) { case im_hiragana: @@ -207,15 +209,17 @@ HRESULT CTextService::_HandleChar(TfEditCookie ec, ITfContext *pContext, WPARAM default: break; } - - _Update(ec, pContext); } else { - _HandleCharShift(ec, pContext); roman.push_back(ch); + } + + if(pContext != NULL) + { _Update(ec, pContext); } + _Update(ec, pContext); break; case E_ABORT: //不一致 @@ -248,6 +252,7 @@ HRESULT CTextService::_HandleChar(TfEditCookie ec, ITfContext *pContext, WPARAM case S_OK: //一致 kana.assign(ajc.jlatin); cursoridx = kana.size(); + _Update(ec, pContext, TRUE); _HandleCharReturn(ec, pContext); break; case E_PENDING: //途中まで一致 @@ -265,6 +270,7 @@ HRESULT CTextService::_HandleChar(TfEditCookie ec, ITfContext *pContext, WPARAM ajc.ascii[1] = L'\0'; kana.assign(ajc.ascii); cursoridx = kana.size(); + _Update(ec, pContext, TRUE); _HandleCharReturn(ec, pContext); break; diff --git a/imcrvtip/KeyHandlerComposition.cpp b/imcrvtip/KeyHandlerComposition.cpp index 9dc094cb..65bebb90 100644 --- a/imcrvtip/KeyHandlerComposition.cpp +++ b/imcrvtip/KeyHandlerComposition.cpp @@ -346,27 +346,6 @@ HRESULT CTextService::_SetText(TfEditCookie ec, ITfContext *pContext, const std: { return S_FALSE; } - - _Vertical = FALSE; - - ITfRange *pRange; - if(_pComposition->GetRange(&pRange) == S_OK) - { - ITfReadOnlyProperty *pReadOnlyProperty; - if(pContext->GetAppProperty(TSATTRID_Text_VerticalWriting, &pReadOnlyProperty) == S_OK) - { - VARIANT var; - if(pReadOnlyProperty->GetValue(ec, pRange, &var) == S_OK) - { - if(var.vt == VT_BOOL) - { - _Vertical = var.boolVal; - } - } - SafeRelease(&pReadOnlyProperty); - } - SafeRelease(&pRange); - } } if(pContext->GetSelection(ec, TF_DEFAULT_SELECTION, 1, &tfSelection, &cFetched) != S_OK) @@ -607,3 +586,32 @@ void CTextService::_EndCompletionList(TfEditCookie ec, ITfContext *pContext) _EndCandidateList(); } } + +BOOL CTextService::_GetVertical(TfEditCookie ec, ITfContext *pContext) +{ + BOOL ret = FALSE; + + if(_IsComposing()) + { + ITfRange *pRange; + if(_pComposition->GetRange(&pRange) == S_OK) + { + ITfReadOnlyProperty *pReadOnlyProperty; + if(pContext->GetAppProperty(TSATTRID_Text_VerticalWriting, &pReadOnlyProperty) == S_OK) + { + VARIANT var; + if(pReadOnlyProperty->GetValue(ec, pRange, &var) == S_OK) + { + if(var.vt == VT_BOOL) + { + ret = var.boolVal; + } + } + SafeRelease(&pReadOnlyProperty); + } + SafeRelease(&pRange); + } + } + + return ret; +} diff --git a/imcrvtip/KeyHandlerControl.cpp b/imcrvtip/KeyHandlerControl.cpp index 82097db2..720cd563 100644 --- a/imcrvtip/KeyHandlerControl.cpp +++ b/imcrvtip/KeyHandlerControl.cpp @@ -358,6 +358,8 @@ HRESULT CTextService::_HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE _NextComp(); + BOOL vertical = _GetVertical(ec, pContext); + if(complement && cx_compuserdic) { if(candidx == 0) @@ -365,7 +367,7 @@ HRESULT CTextService::_HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE _UserDicComp(); } - if((!cx_stacompmulti && !cx_dyncompmulti) || !_Vertical || pContext == NULL) + if((!cx_stacompmulti && !cx_dyncompmulti) || !vertical || pContext == NULL) { okuriidx = kana.size(); if(candidx < candidates.size() && !candidates[candidx].first.second.empty()) @@ -391,7 +393,7 @@ HRESULT CTextService::_HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE _EndCompletionList(ec, pContext); } - if((!cx_stacompmulti && !cx_dyncompmulti) || !_Vertical || pContext == NULL) + if((!cx_stacompmulti && !cx_dyncompmulti) || !vertical || pContext == NULL) { _Update(ec, pContext); } @@ -426,9 +428,11 @@ HRESULT CTextService::_HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE { _PrevComp(); + BOOL vertical = _GetVertical(ec, pContext); + if(complement && cx_compuserdic) { - if((!cx_stacompmulti && !cx_dyncompmulti) || !_Vertical || pContext == NULL) + if((!cx_stacompmulti && !cx_dyncompmulti) || !vertical || pContext == NULL) { okuriidx = kana.size(); if(candidx < candidates.size() && !candidates[candidx].first.second.empty()) @@ -454,7 +458,7 @@ HRESULT CTextService::_HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE _EndCompletionList(ec, pContext); } - if((!cx_stacompmulti && !cx_dyncompmulti) || !_Vertical || pContext == NULL) + if((!cx_stacompmulti && !cx_dyncompmulti) || !vertical || pContext == NULL) { _Update(ec, pContext); } diff --git a/imcrvtip/KeyHandlerConv.cpp b/imcrvtip/KeyHandlerConv.cpp index 3ec2e264..1aa14109 100644 --- a/imcrvtip/KeyHandlerConv.cpp +++ b/imcrvtip/KeyHandlerConv.cpp @@ -616,7 +616,9 @@ void CTextService::_DynamicComp(TfEditCookie ec, ITfContext *pContext, BOOL sel) okuriidx = kana_bak.size(); - if(cx_dynamiccomp && (!cx_dyncompmulti || !_Vertical || pContext == NULL)) + BOOL vertical = _GetVertical(ec, pContext); + + if(cx_dynamiccomp && (!cx_dyncompmulti || !vertical || pContext == NULL)) { kana.insert(okuriidx, 1, CHAR_SKK_OKURI); diff --git a/imcrvtip/TextService.cpp b/imcrvtip/TextService.cpp index 7f2c4743..c19820ea 100644 --- a/imcrvtip/TextService.cpp +++ b/imcrvtip/TextService.cpp @@ -39,7 +39,6 @@ CTextService::CTextService() _ImmersiveMode = FALSE; _UILessMode = FALSE; _ShowInputMode = FALSE; - _Vertical = FALSE; hPipe = INVALID_HANDLE_VALUE; diff --git a/imcrvtip/TextService.h b/imcrvtip/TextService.h index 4029f754..08f889cd 100644 --- a/imcrvtip/TextService.h +++ b/imcrvtip/TextService.h @@ -152,6 +152,7 @@ class CTextService : HRESULT _ShowCandidateList(TfEditCookie ec, ITfContext *pContext, BOOL reg, BOOL comp); void _EndCandidateList(); void _EndCompletionList(TfEditCookie ec, ITfContext *pContext); + BOOL _GetVertical(TfEditCookie ec, ITfContext *pContext); // KeyHandlerControl HRESULT _HandleControl(TfEditCookie ec, ITfContext *pContext, BYTE sf, WCHAR ch); @@ -306,7 +307,6 @@ class CTextService : BOOL _ImmersiveMode; //Immersive Mode BOOL _UILessMode; //UILess Mode BOOL _ShowInputMode; //InputModeWindow - BOOL _Vertical; //Vertical Writing //状態 int inputmode; //入力モード (無し/ひらがな/カタカナ/半角カタカナ/全英/アスキー) diff --git a/installer/README.TXT b/installer/README.TXT index 1eb1c1cf..6f310e4a 100644 --- a/installer/README.TXT +++ b/installer/README.TXT @@ -1,7 +1,7 @@  ============================================================================== - CorvusSKK ver. 1.9.0 + CorvusSKK ver. 1.9.1 https://nathancorvussolis.github.io/ nathancorvussolis@gmail.com @@ -23,6 +23,6 @@ マニュアル - https://github.com/nathancorvussolis/corvusskk/blob/1.9.0/README.md + https://github.com/nathancorvussolis/corvusskk/blob/1.9.1/README.md ============================================================================== diff --git a/installer/_version.cmd b/installer/_version.cmd index 9c35f260..1b2d758a 100644 --- a/installer/_version.cmd +++ b/installer/_version.cmd @@ -1,2 +1,2 @@ -set VERSION=1.9.0 +set VERSION=1.9.1 diff --git a/installer/corvusskk-x64.wxs b/installer/corvusskk-x64.wxs index c75780f1..10feae55 100644 --- a/installer/corvusskk-x64.wxs +++ b/installer/corvusskk-x64.wxs @@ -1,7 +1,7 @@ - + diff --git a/installer/corvusskk-x86.wxs b/installer/corvusskk-x86.wxs index ead6c0fa..18f7d6c6 100644 --- a/installer/corvusskk-x86.wxs +++ b/installer/corvusskk-x86.wxs @@ -1,7 +1,7 @@ - +