Skip to content

未使用メンバ変数削除 (m_bVisualStyle) #2043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gorogoro123
Copy link
Contributor

PR対象

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

カテゴリ

  • 削除

PR の背景

CTabWnd クラスのメンバ変数 (m_bVisualStyle) に値を設定しているが、どこからも参照されない。

仕様・動作説明

CTabWnd クラスのメンバ変数 (m_bVisualStyle) を削除します。

PR の影響範囲

影響なし。

テスト内容

Build が通ることを確認する。

関連 issue, PR

#1684

参考資料

Copy link

@AppVeyorBot
Copy link

@@ -170,11 +170,8 @@ LRESULT CTabWnd::TabWndDispatchEvent( HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
::InvalidateRect( GetHwnd(), NULL, TRUE ); // アクティブタブの位置が変わるのでトップバンドを更新する // 2006.03.27 ryoji
break;

case WM_THEMECHANGED:
m_bVisualStyle = ::IsVisualStyle();
Copy link
Contributor

Choose a reason for hiding this comment

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

「この変数が要らない」わけではなく、本来なら参照すべき箇所(≒OnDrawItem内、2か所)で
「::IsVisualStyle()」を直接呼び出しているために「現状は使われていない」が実情のようです。

あるべき論を語り出すとめんどくさいですが、「テーマ(≒旧称VisualStyle)が有効かどうか」というグローバル状態をウインドウのメッセージディスパッチャクラスのプロパティにキャッシュさせるやり方は、それなりに一般的で妥当な気がします。

「CTabWndクラスが複数ウインドウのメッセージを処理していてメンバー変数もイベントハンドラも多過ぎ、構造が分かりづら過ぎ」というのには同意しますが、このメンバーを削ることで「分かりやすくなるか?」というと微妙に思っています。(実際、変数が保持する情報を使うコードがありますし。)

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.

3 participants