Fix selection event sending for Ctrl-click in generic wxDataViewCtrl.

Ctrl-clicking on the only currently selected item in wxDataViewCtrl crashed
because we dereferenced first element of the empty m_selection array when
generating the selection change event.

Instead, send the event for the current item, this should be more consistent
with the native versions behaviour and at the very least doesn't crash.

Closes #11684.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-02-04 01:20:02 +00:00
parent 1d4b9c37cb
commit 9439bc6955

View File

@@ -3694,7 +3694,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
{
ChangeCurrentRow(current);
ReverseRowSelection(m_currentRow);
SendSelectionChangedEvent(GetItemByRow(m_selection[0]) );
SendSelectionChangedEvent(GetItemByRow(m_currentRow));
}
else if (event.ShiftDown())
{