Skip to content

Conversation

@gorogoro123
Copy link
Contributor

PR対象

  • アプリ(サクラエディタ本体)

カテゴリ

  • 改善

PR の背景

カスタムカラー用の座標をグローバル変数で宣言している。

仕様・動作説明

カスタムカラー用の座標を CPropTypes クラスで宣言します。

PR の影響範囲

影響なし。

テスト内容

設定 - タイプ別設定 - カラー - 文字色/背景色を選択し、色選択ダイアログが表示されることを確認する。

関連 issue, PR

#2061

参考資料

@github-actions
Copy link

Test Results

621 tests  ±0   621 ✅ ±0   1m 24s ⏱️ ±0s
 78 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit bc82d5a. ± Comparison against base commit 4acde38.

int nIndex = -1;
int nItemNum;
RECT rcItem = {0,0,0,0};
int i;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この前方宣言の削除には同意できます。

現代基準で言えば「変数宣言時の初期化忘れ」に見えなくもないわけで。

}else
/* 前景色見本 矩形 */
if( m_fgColorSampleLeft <= xPos && xPos <= m_fgColorSampleRight
if( pCPropTypesColor->m_fgColorSampleLeft <= xPos && xPos <= pCPropTypesColor->m_fgColorSampleRight
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

「pCPropTypesColor->」を付与する直し方の妥当性に疑問があります。

thisスコープでアクセスできるように直せないんでしょうか。(直せないことは分かっている。)

namespace {
//! カスタムカラー用の識別文字列
const WCHAR* TSTR_PTRCUSTOMCOLORS = L"ptrCustomColors";
int m_bgColorSampleLeft;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すでに無名の名前空間に隔離されてるので、
厳密にはグローバル変数でない、
みたいなとこも気になってます。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants