From 3591756166f95aec3ca396e61539794aa0354061 Mon Sep 17 00:00:00 2001 From: Hartwig Date: Mon, 27 Aug 2018 21:07:11 +0200 Subject: [PATCH] Update wxDataViewColumn when sort order changes under macOS The value returned by wxDataViewColumn::IsSortOrderAscending() wasn't updated when the sort order changed due to the user clicking on a column and reversing the sort order. Fix this now by explicitly calling SetSortOrderVariable() when this happens. Closes https://github.com/wxWidgets/wxWidgets/pull/901 --- src/osx/cocoa/dataview.mm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 83b3fd9343..23b0a2511e 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -652,9 +652,12 @@ outlineView:(NSOutlineView*)outlineView for (NSUInteger i=0; iGetColumn([[newDescriptor key] intValue]); + + sortingColumn->SetSortOrderVariable([newDescriptor ascending]); [wxSortDescriptors addObject:[[[wxSortDescriptorObject alloc] initWithModelPtr:model - sortingColumnPtr:dvc->GetColumn([[newDescriptor key] intValue]) + sortingColumnPtr:sortingColumn ascending:[newDescriptor ascending]] autorelease]]; } [(wxCocoaOutlineDataSource*)[outlineView dataSource] setSortDescriptors:wxSortDescriptors];