git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11175
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual wxListItemAttr *OnGetItemAttr(long item) const;
// it calls our OnGetXXX() functions
virtual wxListItemAttr *OnGetItemAttr(long item) const;
// it calls our OnGetXXX() functions
friend class WXDLLEXPORT wxListMainWindow;
private:
friend class WXDLLEXPORT wxListMainWindow;
private:
size_t index = (size_t)lindex;
size_t index = (size_t)lindex;
- // select the next item when the selected one is deleted
- if ( m_current >= index )
+ // we don't need to adjust the index for the previous items
+ if ( HasCurrent() && m_current >= index )
+ // if the current item is being deleted, we want the next one to
+ // become selected - unless there is no next one - so don't adjust
+ // m_current in this case
+ if ( m_current != index || m_current == count - 1 )
+ {
+ m_current--;
+ }