Skip to content

Commit

Permalink
レビュー指摘に対応: assertを除去
Browse files Browse the repository at this point in the history
  • Loading branch information
kengoide committed Dec 11, 2020
1 parent df44223 commit e726726
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sakura_core/dlg/CDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,12 +808,10 @@ LRESULT CALLBACK SubEditProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,

void CDialog::SetComboBoxDeleter(HWND hwndCtl, CRecent* pRecent)
{
assert(pRecent);
assert((::GetWindowLongPtr(hwndCtl, GWL_STYLE) & 0b11) != CBS_DROPDOWNLIST);

if (!pRecent || (::GetWindowLongPtr(hwndCtl, GWL_STYLE) & 0b11) == CBS_DROPDOWNLIST)
return;
COMBOBOXINFO info = { sizeof(COMBOBOXINFO) };
if (!::GetComboBoxInfo(hwndCtl, &info))
return;
assert(info.hwndCombo != info.hwndItem);
::SetWindowSubclass(info.hwndItem, SubEditProc, 0, (DWORD_PTR)pRecent);
}
5 changes: 5 additions & 0 deletions sakura_core/dlg/CDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class CDialog

void ResizeItem( HWND hTarget, const POINT& ptDlgDefalut, const POINT& ptDlgNew, const RECT& rcItemDefault, EAnchorStyle anchor, bool bUpdate = true);
void GetItemClientRect( int wID, RECT& rc );

//! @brief コンボボックスに履歴削除・単語削除の機能を追加する
//!
//! @param hwndCtl コンボボックスのハンドル。CBS_DROPDOWNLISTスタイルのコンボボックスには対応していません。
//! @param pRecent 紐づけるCRecentへのポインタ。nullptrは指定できません。
static void SetComboBoxDeleter( HWND hwndCtl, CRecent* pRecent );
public:

Expand Down

0 comments on commit e726726

Please sign in to comment.