Fix keyboard navigation crash in single column generic wxDataViewCtrl

Selecting a leaf node in a wxDataViewCtrl and then pressing the right arrow
key resulted in using an out-of-bounds index for accessing the columns list.

Fix this by setting the current column to the first one, and not to the second
one which might not exist.

See #17537.

(cherry picked from commit 5d671d8136)
This commit is contained in:
Eric Raijmakers
2016-05-14 15:53:28 +02:00
committed by Vadim Zeitlin
parent 3cacee9d52
commit d8e6043602

View File

@@ -4006,7 +4006,7 @@ bool wxDataViewMainWindow::TryAdvanceCurrentColumn(wxDataViewTreeNode *node, boo
{
if ( forward )
{
m_currentCol = GetOwner()->GetColumnAt(1);
m_currentCol = GetOwner()->GetColumnAt(0);
m_currentColSetByKeyboard = true;
RefreshRow(m_currentRow);
return true;