Fix recently broken assert for virtual wxGenericListCtrl
The changes of 8c1234ea66 (Improve assert checking line index validity
in wxGenericListCtrl, 2023-07-24) were wrong for virtual list controls
as the lines vector is not used for them, so restrict the assert to the
non-virtual case only.
This commit is contained in:
parent
66cb7089f8
commit
0436cebd82
1 changed files with 4 additions and 3 deletions
|
|
@ -845,15 +845,16 @@ protected:
|
|||
// get the line data for the given index
|
||||
wxListLineData *GetLine(size_t n) const
|
||||
{
|
||||
wxCHECK_MSG( n < m_lines.size(), nullptr, wxT("invalid line index") );
|
||||
|
||||
wxListMainWindow *self = wxConstCast(this, wxListMainWindow);
|
||||
|
||||
if ( IsVirtual() )
|
||||
{
|
||||
self->CacheLineData(n);
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCHECK_MSG( n < m_lines.size(), nullptr, wxT("invalid line index") );
|
||||
}
|
||||
|
||||
return &self->m_lines[n];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue