]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't handle branches specially when sorting items in wxDataViewCtrl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 May 2012 21:37:10 +0000 (21:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 13 May 2012 21:37:10 +0000 (21:37 +0000)
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

src/common/datavcmn.cpp

index db46cfbc292e818d3915b06ff65d8b2ea34a4992..f687e7f9a07f925ba825db778e532ac82d61cab4 100644 (file)
@@ -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 );