Skip to content

Conversation

@gorogoro123
Copy link
Contributor

PR対象

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

カテゴリ

  • 改善

PR の背景

CDlgOpenFile_CommonFileDialog クラスで、メンバ変数をコンストラクタで初期化している。

仕様・動作説明

変数宣言時に初期化するようにします。

PR の影響範囲

影響なし。

テスト内容

  1. 設定 - 共通設定 - 編集 - Vistaスタイルのファイルダイアログ のチェック をはずす
  2. 変更前後で、 CDlgOpenFile_CommonFileDialog クラスのコンストラクタに break を設定し、メンバ変数を確認する。

関連 issue, PR

#2110
#2134

参考資料

@github-actions
Copy link

Test Results

622 tests  ±0   622 ✅ ±0   1m 27s ⏱️ -6s
 78 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit cd1c0d5. ± Comparison against base commit e7966fc.

Copy link
Contributor

@berryzplus berryzplus left a comment

Choose a reason for hiding this comment

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

対応ありがとうございます。

HINSTANCE m_hInstance = nullptr;/* アプリケーションインスタンスのハンドル */
HWND m_hwndParent = nullptr;/* オーナーウィンドウのハンドル */

DLLSHAREDATA* m_pShareData;
Copy link
Contributor

Choose a reason for hiding this comment

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

指摘じゃないです。

このクラスは コモンダイアログ をの挙動をカスタマイズしたウインドウのメッセージハンドリングを制御するものなのです。

  • 「ファイルを開く」ダイアログ 普通のダイアログの特殊化。
    • ダイアログ 普通のウインドウの拡張。定義済みのウインドウサブクラス。
      • ウインドウ 定義済みでない限り、全部自分で実装

ダイアログの特殊化が厄介なのは、ダイアログとしてサブクラス化するかウインドウとしてサブクラス化するかを選べてしまうあたり。

CDialog は m_pShareData を持ってるので、継承させるならこのメンバーは要らなくなります。

どちらにしても m_pShareData をもつクラスを独立させて消しに行った方がよいような気がしています。

@berryzplus berryzplus merged commit f18464a into sakura-editor:master Dec 24, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants