Skip to content

Commit cccc75e

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 1ee2e2a + 53ea30b commit cccc75e

14 files changed

+110
-47
lines changed

.github/workflows/sonarscan.yml

+4
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ jobs:
6464
- name: Setup MSBuild
6565
uses: microsoft/setup-msbuild@v1
6666

67+
- name: Run the normal MSBuild process
68+
run: build-sln.bat ${{ env.BUILD_PLATFORM }} ${{ env.BUILD_CONFIGURATION }}
69+
shell: cmd
70+
6771
- name: Fetch Build-Wrapper
6872
working-directory: ${{ github.workspace }}\.sonar
6973
run: |

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ vs_community__XXXXX.exe --config <.vsconfig のファイルパス>
123123

124124
## How to build
125125

126-
- [7Zip](https://sevenzip.osdn.jp/) のインストールして 7z.exe へのパスを通します。
126+
- [7-Zip](https://7-zip.opensource.jp/) をインストールして 7z.exe へのパスを通します。
127127
- Visual Studio で `sakura.sln` を開いてビルドします。
128128

129129
### 詳細情報

build.md

+51-14
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
- [githash.h の更新のスキップ](#githashh-の更新のスキップ)
2525
- [Powershell によるZIPファイルの圧縮、解凍、内容確認の強制](#powershell-によるzipファイルの圧縮解凍内容確認の強制)
2626
- [CI でのビルドをスキップする方法](#ci-でのビルドをスキップする方法)
27+
- [参考情報](#参考情報)
2728
- [MinGW w64 ビルド](#mingw-w64-ビルド)
29+
- [MinGW w64 インストール方法](#mingw-w64-インストール方法)
30+
- [Msys2 コンソールを開く方法](#msys2-コンソールを開く方法)
31+
- [Msys2 インストール方法](#msys2-インストール方法)
32+
- [PowerShell の管理者コンソールを開く方法](#powershell-の管理者コンソールを開く方法)
33+
- [Chocolatey のインストール方法](#chocolatey-のインストール方法)
2834

2935
<!-- /TOC -->
3036

@@ -188,26 +194,57 @@ build-sln.bat x64 Debug
188194

189195
生成されるバイナリは正しく動作しないが、MinGWでのビルドも可能。
190196

197+
コマンド実行例([MinGW w64](#mingw-w64-インストール方法) のインストールが必要。)
191198

192-
MinGW64のビルド環境
199+
```cmd
200+
build-gnu.bat MinGW Debug
201+
build-gnu.bat MinGW Release
202+
```
193203

194-
* [pleiades 4.6 Neon](http://mergedoc.osdn.jp/)
195-
* [MSYS2+MinGW-w64](https://gist.github.com/Hamayama/eb4b4824ada3ac71beee0c9bb5fa546d)
196-
* [MinGW-w64](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/)
204+
### MinGW w64 インストール方法
197205

198-
cpu | thread モデル | 例外モデル | コメント
199-
---- | ---- | ---- | ----
200-
x86_64 | win32 | seh | windows向け。外部DLL不要
201-
x86_64 | posix | seh | 標準。pthreadのDLLが必要
202-
x86_64 | win32 | sjlj | 外部DLL不要
203-
x86_64 | posix | sjlj | pthreadのDLLが必要
206+
[Msys2 コンソール](#msys2-コンソールを開く方法) で以下のコマンドを入力し `pacman` パッケージ を最新化します。
204207

205-
標準的なMinGWセットアップでビルドしたバイナリは ```libwinpthread-1.dll``` に依存することに注意。
208+
```bash
209+
pacman -Syuu
210+
```
206211

212+
[Msys2 コンソール](#msys2-コンソールを開く方法) で以下のコマンドを入力し `MinGW-w64` をインストールします。
207213

208-
コマンド実行例
214+
```bash
215+
pacman -S --noconfirm mingw-w64-x86_64-toolchain
216+
```
217+
218+
### Msys2 コンソールを開く方法
219+
220+
`C:\msys64\msys2.exe` を実行します。([Msys2](#msys2-インストール方法) のインストールが必要。)
221+
222+
### Msys2 インストール方法
223+
224+
[PowerShell の管理者コンソール](#powershell-の管理者コンソールを開く方法)で以下のコマンドを入力し `msys2` をインストールします。([Chocolatey](#chocolatey-のインストール方法) のインストールが必要。)
225+
226+
```powershell
227+
choco install msys2 --params "/InstallDir:C:\msys64"
228+
```
229+
230+
### PowerShell の管理者コンソールを開く方法
231+
232+
Windowsタスクバーの検索窓に `powershell` と入力します。
233+
234+
検索結果に `Windows PowerShell (x86)` が表示されるので `管理者として実行` をクリックします。
235+
236+
### Chocolatey のインストール方法
209237

238+
[PowerShell の管理者コンソール](#powershell-の管理者コンソールを開く方法) で以下のコマンドを実行します。
239+
240+
```powershell
241+
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
210242
```
211-
path=C:\msys64\mingw64\bin;%path%
212-
mingw32-make -C sakura_core -j4
243+
244+
詳細な手順は [Chocolateyの公式サイト](https://chocolatey.org/install) で確認してください。
245+
246+
[PowerShell の管理者コンソール](#powershell-の管理者コンソールを開く方法) で以下のコマンドを実行し `Chocolatey` のバージョンが表示されたらインストールできています。
247+
248+
```powershell
249+
choco
213250
```

sakura_core/apiwrap/StdControl.h

+10
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ UNICODE版では問題無いが、ANSI版では設定の前にコード変換す
4141

4242
#include <windows.h>
4343
#include <Commctrl.h>
44+
#include <shlwapi.h>
4445
#include "mem/CNativeW.h"
4546
#include <vector>
4647

@@ -219,6 +220,15 @@ namespace ApiWrap{
219220
{
220221
::SendMessage( hwndCombo, CB_GETEDITSEL, WPARAM( &dwSelStart ), LPARAM( &dwSelEnd ) );
221222
}
223+
inline void Combo_SHAutoComplete( HWND hwndCombo, DWORD dwFlags )
224+
{
225+
COMBOBOXINFO comboInfo;
226+
comboInfo.cbSize = sizeof(comboInfo);
227+
if (0 != GetComboBoxInfo(hwndCombo, &comboInfo))
228+
{
229+
SHAutoComplete(comboInfo.hwndItem, dwFlags);
230+
}
231+
}
222232

223233
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- //
224234
// リストボックス //

sakura_core/cmd/CViewCommander_Edit.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ void CViewCommander::DelCharForOverwrite( const wchar_t* pszInput, int nLen )
900900
nPos += CNativeW::GetSizeOfChar(line.GetPtr(), line.GetLength(), nPos);
901901
nDelLen = 1;
902902
if( nKetaDiff < 0 && nPos < line.GetLength() ){
903-
wchar_t c = line.At(nPos);
903+
wchar_t c = line[nPos];
904904
if( c != WCODE::TAB && !WCODE::IsLineDelimiter(c,
905905
GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
906906
nDelLen = 2;

sakura_core/dlg/CDlgGrep.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ BOOL CDlgGrep::OnInitDialog( HWND hwndDlg, WPARAM wParam, LPARAM lParam )
323323
Combo_SetExtendedUI( GetItemHwnd( IDC_COMBO_EXCLUDE_FILE ), TRUE );
324324
Combo_SetExtendedUI( GetItemHwnd( IDC_COMBO_EXCLUDE_FOLDER ), TRUE );
325325

326+
/* 入力補完を機能させる */
327+
Combo_SHAutoComplete(GetItemHwnd( IDC_COMBO_FOLDER ), SHACF_FILESYS_DIRS|SHACF_AUTOAPPEND_FORCE_ON);
328+
326329
/* ダイアログのアイコン */
327330
//2002.02.08 Grepアイコンも大きいアイコンと小さいアイコンを別々にする。
328331
HICON hIconBig, hIconSmall;

sakura_core/doc/layout/CLayoutMgr_DoLayout.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static bool _GetKeywordLength(
4848
CLogicInt nWordBgn = nPos;
4949
CLogicInt nWordLen = CLogicInt(0);
5050
CLayoutInt nWordKetas = CLayoutInt(0);
51-
while(nPos<cLineStr.GetLength() && IS_KEYWORD_CHAR(cLineStr.At(nPos))){
51+
while(nPos<cLineStr.GetLength() && IS_KEYWORD_CHAR(cLineStr[nPos])){
5252
CLogicXInt nCharSize = CNativeW::GetSizeOfChar( cLineStr, nPos );
5353
CLayoutInt k = cLayoutMgr.GetLayoutXOfChar(cLineStr, nPos);
5454

@@ -209,8 +209,8 @@ void CLayoutMgr::_DoGyotoKinsoku(SLayoutWork* pWork, PF_OnLine pfOnLine)
209209

210210
if( _IsKinsokuPosHead( GetMaxLineLayout() - pWork->nPosX, nCharKetas1, nCharKetas2 )
211211
&& IsKinsokuHead( pWork->cLineStr.At( pWork->nPos + nCharSize ) )
212-
&& !IsKinsokuHead( pWork->cLineStr.At( pWork->nPos ) ) // 1字前が行頭禁則の対象でないこと
213-
&& !IsKinsokuKuto( pWork->cLineStr.At( pWork->nPos ) ) ) // 1字前が句読点ぶら下げの対象でないこと
212+
&& !IsKinsokuHead( pWork->cLineStr[ pWork->nPos ] ) // 1字前が行頭禁則の対象でないこと
213+
&& !IsKinsokuKuto( pWork->cLineStr[ pWork->nPos ] ) ) // 1字前が句読点ぶら下げの対象でないこと
214214
{
215215
pWork->nWordBgn = pWork->nPos;
216216
pWork->nWordLen = nCharSize + CNativeW::GetSizeOfChar( pWork->cLineStr, pWork->nPos + nCharSize );
@@ -233,7 +233,7 @@ void CLayoutMgr::_DoGyomatsuKinsoku(SLayoutWork* pWork, PF_OnLine pfOnLine)
233233
CLayoutXInt nCharKetas1 = GetLayoutXOfChar( pWork->cLineStr, pWork->nPos );
234234
CLayoutXInt nCharKetas2 = GetLayoutXOfChar( pWork->cLineStr, pWork->nPos + nCharSize );
235235

236-
if( _IsKinsokuPosTail( GetMaxLineLayout() - pWork->nPosX, nCharKetas1, nCharKetas2 ) && IsKinsokuTail( pWork->cLineStr.At( pWork->nPos ) ) )
236+
if( _IsKinsokuPosTail( GetMaxLineLayout() - pWork->nPosX, nCharKetas1, nCharKetas2 ) && IsKinsokuTail( pWork->cLineStr[ pWork->nPos ] ) )
237237
{
238238
pWork->nWordBgn = pWork->nPos;
239239
pWork->nWordLen = nCharSize;
@@ -305,7 +305,7 @@ void CLayoutMgr::_MakeOneLine(SLayoutWork* pWork, PF_OnLine pfOnLine)
305305
//@@@ 2002.09.22 YAZAKI
306306
color.CheckColorMODE( &pWork->pcColorStrategy, pWork->nPos, pWork->cLineStr );
307307

308-
if( pWork->cLineStr.At(pWork->nPos) == WCODE::TAB ){
308+
if( pWork->cLineStr[pWork->nPos] == WCODE::TAB ){
309309
if(_DoTab(pWork, pfOnLine)){
310310
continue;
311311
}

sakura_core/env/CShareData.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ bool CShareData::InitShareData()
355355
sEdit.m_bConvertEOLPaste = false; /* 改行コードを変換して貼り付ける */ // 2009.02.28 salarm
356356
sEdit.m_bEnableExtEol = false;
357357
sEdit.m_bBoxSelectLock = true;
358-
sEdit.m_bVistaStyleFileDialog = false;
358+
sEdit.m_bVistaStyleFileDialog = true;
359359

360360
sEdit.m_bNotOverWriteCRLF = TRUE; /* 改行は上書きしない */
361361
sEdit.m_bOverWriteFixMode = false; // 文字幅に合わせてスペースを詰める

sakura_core/mem/CNativeW.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class CStringRef final{
4545
[[nodiscard]] int GetLength() const noexcept { return static_cast<int>(m_nDataLen); }
4646
[[nodiscard]] bool IsValid() const noexcept { return m_pData != nullptr; }
4747
[[nodiscard]] wchar_t At( size_t nIndex ) const noexcept;
48+
[[nodiscard]] wchar_t operator []( size_t nIndex ) const noexcept { return m_pData[nIndex]; }
4849

4950
private:
5051
const wchar_t* m_pData = nullptr;

sakura_core/view/CRuler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ void CRuler::DrawRulerBg(CGraphics& gr)
184184

185185
// 目盛り線を1本ずつ描画するのではなく後述する PolyPolyline でまとめて描画を行う
186186
const int nWidth = (Int)(m_pEditView->GetTextArea().GetRightCol() - i);
187-
const size_t nLinesToDraw = 1 + std::min<int>((nWidth + 1 + 1 + oneColumn - 1) / oneColumn, nMaxLineKetas - keta + 1);
187+
const size_t nLinesToDraw = 1 + std::min<int>((nWidth + 1 + 1 + oneColumn - 1) / oneColumn, std::max(nMaxLineKetas - keta, 0) + 1);
188188
auto& apt = m_apt;
189189
auto& asz = m_asz;
190190
apt.resize(nLinesToDraw * 2);

sakura_core/view/colors/CColor_Comment.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ bool CColor_LineComment::EndColor(const CStringRef& cStr, int nPos)
5151
}
5252

5353
//改行
54-
if( WCODE::IsLineDelimiter(cStr.At(nPos), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
54+
if( WCODE::IsLineDelimiter(cStr[nPos], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
5555
return true;
5656
}
5757

sakura_core/view/colors/CColor_Heredoc.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -78,21 +78,21 @@ bool CColor_Heredoc::BeginColor(const CStringRef& cStr, int nPos)
7878
const int length = cStr.GetLength();
7979
int nPosIdStart = nPos + 3;
8080
for(; nPosIdStart < length; nPosIdStart++ ){
81-
if(cStr.At(nPosIdStart) != L'\t' && cStr.At(nPosIdStart) != L' '){
81+
if(cStr[nPosIdStart] != L'\t' && cStr[nPosIdStart] != L' '){
8282
break;
8383
}
8484
}
8585
wchar_t quote = L'\0';
8686
if( !(nPosIdStart < length) ){
8787
return false;
8888
}
89-
if( cStr.At(nPosIdStart) == L'\'' || cStr.At(nPosIdStart) == L'"' ){
90-
quote = cStr.At(nPosIdStart);
89+
if (cStr[nPosIdStart] == L'\'' || cStr[nPosIdStart] == L'"') {
90+
quote = cStr[nPosIdStart];
9191
nPosIdStart++;
9292
}
9393
int i = nPosIdStart;
9494
for(; i < length; i++ ){
95-
if( !(WCODE::IsAZ(cStr.At(i)) || WCODE::Is09(cStr.At(i)) || cStr.At(i) == L'_') ){
95+
if( !(WCODE::IsAZ(cStr[i]) || WCODE::Is09(cStr[i]) || cStr[i] == L'_') ){
9696
break;
9797
}
9898
}
@@ -101,13 +101,13 @@ bool CColor_Heredoc::BeginColor(const CStringRef& cStr, int nPos)
101101
}
102102
const int k = i;
103103
if( quote != L'\0' ){
104-
if( i < length && cStr.At(i) == quote ){
104+
if( i < length && cStr[i] == quote ){
105105
i++;
106106
}else{
107107
return false;
108108
}
109109
}
110-
if( i < length && WCODE::IsLineDelimiter(cStr.At(i), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
110+
if( i < length && WCODE::IsLineDelimiter(cStr[i], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
111111
m_id = std::wstring(cStr.GetPtr()+nPosIdStart, k - nPosIdStart);
112112
m_pszId = m_id.c_str();
113113
m_nSize = m_id.size();
@@ -129,11 +129,11 @@ bool CColor_Heredoc::EndColor(const CStringRef& cStr, int nPos)
129129
return false;
130130
}else{
131131
int i = m_nSize;
132-
if( i + 1 < cStr.GetLength() && cStr.At(i) == L';' && WCODE::IsLineDelimiter(cStr.At(i+1), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
132+
if( i + 1 < cStr.GetLength() && cStr[i] == L';' && WCODE::IsLineDelimiter(cStr[i+1], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
133133
// ID;
134134
this->m_nCOMMENTEND = i;
135135
return false;
136-
}else if( m_nSize < cStr.GetLength() && WCODE::IsLineDelimiter(cStr.At(m_nSize), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
136+
}else if( m_nSize < cStr.GetLength() && WCODE::IsLineDelimiter(cStr[m_nSize], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
137137
// ID
138138
this->m_nCOMMENTEND = m_nSize;
139139
return false;

sakura_core/view/colors/CColor_Quote.cpp

+14-14
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ bool CColor_Quote::IsCppRawString(const CStringRef& cStr, int nPos)
103103
// \b = ^|[\s!"#$%&'()=@{};:<>?,.*/\-\+\[\]\]
104104
wchar_t c1 = L' ';
105105
if( 2 <= nPos ){
106-
c1 = cStr.At(nPos-2);
106+
c1 = cStr[nPos-2];
107107
}
108108
wchar_t c2 = L' ';
109109
if( 3 <= nPos ){
110-
c2 = cStr.At(nPos-3);
110+
c2 = cStr[nPos-3];
111111
}
112112
const wchar_t* pszSep = L" \t!\"#$%&'()=@{};:<>?,.*/-+[]";
113113
if( (c1 == 'u' || c1 == 'U' || c1 == 'L') ){
@@ -117,7 +117,7 @@ bool CColor_Quote::IsCppRawString(const CStringRef& cStr, int nPos)
117117
}else if( c1 == '8' && c2 == 'u' ){
118118
wchar_t c3 = L'\0';
119119
if( 4 <= nPos ){
120-
c3 = cStr.At(nPos-4);
120+
c3 = cStr[nPos-4];
121121
}
122122
if( NULL != wcschr(pszSep, c3) ){
123123
return true;
@@ -142,7 +142,7 @@ bool CColor_Quote::BeginColor(const CStringRef& cStr, int nPos)
142142
case STRING_LITERAL_CPP:
143143
if( IsCppRawString(cStr, nPos) ){
144144
for( int i = nPos + 1; i < cStr.GetLength(); i++ ){
145-
if( cStr.At(i) == '(' ){
145+
if( cStr[i] == '(' ){
146146
if( nPos + 1 < i ){
147147
m_tag = L')';
148148
m_tag.append( cStr.GetPtr()+nPos+1, i - (nPos + 1) );
@@ -179,7 +179,7 @@ bool CColor_Quote::BeginColor(const CStringRef& cStr, int nPos)
179179
break;
180180
case STRING_LITERAL_PYTHON:
181181
if( nPos + 2 < cStr.GetLength()
182-
&& cStr.At(nPos+1) == m_cQuote && cStr.At(nPos+2) == m_cQuote ){
182+
&& cStr[nPos+1] == m_cQuote && cStr[nPos+2] == m_cQuote ){
183183
m_nCOMMENTEND = Match_QuoteStr( m_szQuote, 3, nPos + 3, cStr, true );
184184
m_nColorTypeIndex = 3;
185185
return true;
@@ -198,9 +198,9 @@ bool CColor_Quote::BeginColor(const CStringRef& cStr, int nPos)
198198
// 終了文字列がない場合は行末までを色分け
199199
if( m_pTypeData->m_bStringEndLine ){
200200
// 改行コードを除く
201-
if( 0 < cStr.GetLength() && WCODE::IsLineDelimiter(cStr.At(cStr.GetLength()-1), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
202-
if( 1 < cStr.GetLength() && cStr.At(cStr.GetLength()-2) == WCODE::CR
203-
&& cStr.At(cStr.GetLength()-1) == WCODE::LF ){
201+
if( 0 < cStr.GetLength() && WCODE::IsLineDelimiter(cStr[cStr.GetLength()-1], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
202+
if( 1 < cStr.GetLength() && cStr[cStr.GetLength()-2] == WCODE::CR
203+
&& cStr[cStr.GetLength()-1] == WCODE::LF ){
204204
m_nCOMMENTEND = cStr.GetLength() - 2;
205205
}else{
206206
m_nCOMMENTEND = cStr.GetLength() - 1;
@@ -256,29 +256,29 @@ int CColor_Quote::Match_Quote( wchar_t wcQuote, int nPos, const CStringRef& cLin
256256
nCharChars = (Int)t_max(CLogicInt(1), CNativeW::GetSizeOfChar( cLineStr.GetPtr(), cLineStr.GetLength(), i ));
257257
if( escapeType == STRING_LITERAL_CPP ){
258258
// エスケープ \"
259-
if( 1 == nCharChars && cLineStr.At(i) == L'\\' ){
259+
if( 1 == nCharChars && cLineStr[i] == L'\\' ){
260260
++i;
261-
if( i < cLineStr.GetLength() && WCODE::IsLineDelimiter(cLineStr.At(i), GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
261+
if( i < cLineStr.GetLength() && WCODE::IsLineDelimiter(cLineStr[i], GetDllShareData().m_Common.m_sEdit.m_bEnableExtEol) ){
262262
if( pbEscapeEnd ){
263263
*pbEscapeEnd = true;
264264
}
265265
}
266266
}else
267-
if( 1 == nCharChars && cLineStr.At(i) == wcQuote ){
267+
if( 1 == nCharChars && cLineStr[i] == wcQuote ){
268268
return i + 1;
269269
}
270270
}else if( escapeType == STRING_LITERAL_PLSQL ){
271271
// エスケープ ""
272-
if( 1 == nCharChars && cLineStr.At(i) == wcQuote ){
273-
if( i + 1 < cLineStr.GetLength() && cLineStr.At(i + 1) == wcQuote ){
272+
if( 1 == nCharChars && cLineStr[i] == wcQuote ){
273+
if( i + 1 < cLineStr.GetLength() && cLineStr[i + 1] == wcQuote ){
274274
++i;
275275
}else{
276276
return i + 1;
277277
}
278278
}
279279
}else{
280280
// エスケープなし
281-
if( 1 == nCharChars && cLineStr.At(i) == wcQuote ){
281+
if( 1 == nCharChars && cLineStr[i] == wcQuote ){
282282
return i + 1;
283283
}
284284
}

sakura_core/view/figures/CFigure_Comma.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ void CFigure_Comma::DispSpace(CGraphics& gr, DispPos* pDispPos, CEditView* pcVie
9090
if (szViewString.length() < nTabDispWidth) {
9191
szViewString.append(nTabDispWidth - szViewString.length(), L' ');
9292
}
93+
const INT* lpDx;
94+
if( szViewString.length() > 64 ) {
95+
static std::vector<int> anHankakuDx; //!< 半角用文字間隔配列
96+
anHankakuDx.resize(szViewString.length(), pMetrics->GetHankakuDx());
97+
lpDx = &anHankakuDx[0];
98+
}else {
99+
lpDx = pMetrics->GetDxArray_AllHankaku();
100+
}
93101
::ExtTextOut(
94102
gr,
95103
sPos.GetDrawPos().x,
@@ -98,7 +106,7 @@ void CFigure_Comma::DispSpace(CGraphics& gr, DispPos* pDispPos, CEditView* pcVie
98106
&rcClip2,
99107
szViewString.c_str(),
100108
static_cast<UINT>(szViewString.length()),
101-
pMetrics->GetDxArray_AllHankaku()
109+
lpDx
102110
);
103111
}
104112
}

0 commit comments

Comments
 (0)