From be12bc6a8aaeaf1721a4461c37ea3d1b4878c75a Mon Sep 17 00:00:00 2001 From: Pavel Kalugin Date: Wed, 13 Feb 2019 06:32:37 +0300 Subject: [PATCH] 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 36a5983f64c0f9adfdc67b5c11fe44671cea1ab5 and only fixed for virtual list controls, but not all the other ones, in 9f5af0a49489d2123db83daa58e3b67ec9b8fe09. --- src/generic/datavgen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 21b4bc02de..ada42e388b 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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();