UI: Use wxID_ANY and wxNOT_FOUND instead of hardcoding -1 (#1581)
Some checks failed
Generate translation template / generate-pot (push) Failing after 1s
Build check / build (push) Has been cancelled

This commit is contained in:
oltolm 2025-05-30 01:39:02 +02:00 committed by GitHub
parent 02616bf6be
commit 152b790242
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 48 additions and 48 deletions

View file

@ -107,7 +107,7 @@ wxString SymbolListCtrl::OnGetItemText(long item, long column) const
void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
{
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected == -1)
if (selected == wxNOT_FOUND)
return;
const auto text = GetItemText(selected, ColumnAddress);
const auto address = std::stoul(text.ToStdString(), nullptr, 16);
@ -120,7 +120,7 @@ void SymbolListCtrl::OnLeftDClick(wxListEvent& event)
void SymbolListCtrl::OnRightClick(wxListEvent& event)
{
long selected = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected == -1)
if (selected == wxNOT_FOUND)
return;
auto text = GetItemText(selected, ColumnAddress);
text = "0x" + text;
@ -162,4 +162,4 @@ void SymbolListCtrl::ChangeListFilter(std::string filter)
SetItemCount(visible_entries);
if (visible_entries > 0)
RefreshItems(GetTopItem(), std::min<long>(visible_entries - 1, GetTopItem() + GetCountPerPage() + 1));
}
}