OS X: Reset selection in wxDataViewCtrl::SetSelections

SetSelections() should reset selection to the specified items
(consistently with other platforms), not add these items to the existing
selection.
This commit is contained in:
Václav Slavík
2016-10-06 17:31:11 +02:00
parent ae93a83e76
commit 71aa152af2

View File

@@ -589,6 +589,10 @@ void wxDataViewCtrl::SelectAll()
void wxDataViewCtrl::SetSelections(wxDataViewItemArray const& sel)
{
wxDataViewWidgetImpl* dataViewWidgetPtr(GetDataViewPeer());
dataViewWidgetPtr->UnselectAll();
size_t const noOfSelections = sel.GetCount();
size_t i;
@@ -608,8 +612,6 @@ void wxDataViewCtrl::SetSelections(wxDataViewItemArray const& sel)
}
// finally select the items:
wxDataViewWidgetImpl* dataViewWidgetPtr(GetDataViewPeer()); // variable definition for abbreviational purposes
for (i=0; i<noOfSelections; ++i)
dataViewWidgetPtr->Select(sel[i]);
}