Don't handle branches specially when sorting items in wxDataViewCtrl.
The generic version of wxDataViewCtrl tried to put all branches before the leaves when sorting. This had a couple of problems: first, it didn't do it correctly and actually placed the branches after the leaves which didn't make any sense. Second, this was only done in the generic version and not the native GTK one making the behaviour inconsistent between platforms. Finally, this behaviour just doesn't make sense in general (i.e. when items don't necessarily represent anything in the file system and maybe even sometimes when they do) and there doesn't seem any good reason to do it by default. So stop doing it, partially reverting the changes of r47562. Closes #14100. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
bf0f2c4b33
commit
f3027fae17
@ -308,15 +308,6 @@ void wxDataViewModel::RemoveNotifier( wxDataViewModelNotifier *notifier )
|
||||
int wxDataViewModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
|
||||
unsigned int column, bool ascending ) const
|
||||
{
|
||||
// sort branches before leaves
|
||||
bool item1_is_container = IsContainer(item1);
|
||||
bool item2_is_container = IsContainer(item2);
|
||||
|
||||
if (item1_is_container && !item2_is_container)
|
||||
return 1;
|
||||
if (item2_is_container && !item1_is_container)
|
||||
return -1;
|
||||
|
||||
wxVariant value1,value2;
|
||||
GetValue( value1, item1, column );
|
||||
GetValue( value2, item2, column );
|
||||
|
Loading…
Reference in New Issue
Block a user