Correct test for maximal row index in generic wxDataViewCtrl.
The comparison in EVT_CHAR handler was incorrect for an empty control without any rows as it subtracting 1 from 0 resulted in UINT_MAX and not -1 as all the values were unsigned. Fix this by checking that the new row is valid instead, this is correct for both signed and unsigned values. Closes #13356. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68320 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -3374,7 +3374,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
|
||||
break;
|
||||
|
||||
case WXK_DOWN:
|
||||
if ( m_currentRow < GetRowCount() - 1 )
|
||||
if ( m_currentRow + 1 < GetRowCount() )
|
||||
OnArrowChar( m_currentRow + 1, event );
|
||||
break;
|
||||
// Add the process for tree expanding/collapsing
|
||||
|
Reference in New Issue
Block a user