]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix the comparison function in the list control sample to do what it says.
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 13 May 2011 13:30:07 +0000 (13:30 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 13 May 2011 13:30:07 +0000 (13:30 +0000)
The comment in the function implied that it exchanged the items but in fact it
did not and kept their existing order instead.

Do revert them now, at least like this something visibly happens in the sample
when the items are sorted.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/listctrl/listtest.cpp

index b9539d55b08388b46efc540b5ff14d7c843f46b6..0536b200768f2df7177d69453a86ac65ccd7304f 100644 (file)
@@ -74,9 +74,9 @@ MyCompareFunction(wxIntPtr item1, wxIntPtr item2, wxIntPtr WXUNUSED(sortData))
 {
     // inverse the order
     if (item1 < item2)
-        return -1;
-    if (item1 > item2)
         return 1;
+    if (item1 > item2)
+        return -1;
 
     return 0;
 }