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.

Closes #17537.
This commit is contained in:
Eric Raijmakers
2016-05-14 15:53:28 +02:00
committed by Vadim Zeitlin
parent 311b4d1b14
commit 5d671d8136

View File

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