Fix selection in generic wxDataViewCtrl after adding an item

Notify m_selection about the new item in all cases, not just when using
a virtual list model.

This was broken back in 36a5983f64 and
only fixed for virtual list controls, but not all the other ones, in
9f5af0a494.
This commit is contained in:
Pavel Kalugin
2019-02-13 06:32:37 +03:00
committed by Vadim Zeitlin
parent dd56499fe9
commit be12bc6a8a

View File

@@ -2768,8 +2768,6 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData
wxDataViewVirtualListModel *list_model =
(wxDataViewVirtualListModel*) GetModel();
m_count = list_model->GetCount();
m_selection.OnItemsInserted(GetRowByItem(item), 1);
}
else
{
@@ -2860,6 +2858,8 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData
InvalidateCount();
}
m_selection.OnItemsInserted(GetRowByItem(item), 1);
GetOwner()->InvalidateColBestWidths();
UpdateDisplay();