]> git.saurik.com Git - wxWidgets.git/commitdiff
reset selection when sorting the items as they don't make sense after items change...
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 5 Jul 2007 22:50:21 +0000 (22:50 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 5 Jul 2007 22:50:21 +0000 (22:50 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/listctrl.cpp

index 643b67245cbceb763de19eb0c6fcb4688015bb01..627f683f443c9500c4ce1838c6702da19a223800 100644 (file)
@@ -4810,6 +4810,11 @@ int LINKAGEMODE list_ctrl_compare_func_1( wxListLineData **arg1, wxListLineData
 
 void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
 {
 
 void wxListMainWindow::SortItems( wxListCtrlCompare fn, long data )
 {
+    // selections won't make sense any more after sorting the items so reset
+    // them
+    HighlightAll(false);
+    ResetCurrent();
+
     list_ctrl_compare_func_2 = fn;
     list_ctrl_compare_data = data;
     m_lines.Sort( list_ctrl_compare_func_1 );
     list_ctrl_compare_func_2 = fn;
     list_ctrl_compare_data = data;
     m_lines.Sort( list_ctrl_compare_func_1 );