Patch #2871 2009-12-22 21:49

tpetrov

Make double click open the correct item in the TODO window
Download
2871-Make_double_cl.patch (770 bytes)
Category
Application::Bugfix
Status
Accepted
Close date
2010-08-23 05:51
Assigned to
mortenmacfly
Index: src/plugins/todo/todolistview.cpp
===================================================================
--- src/plugins/todo/todolistview.cpp    (revision 5986)
+++ src/plugins/todo/todolistview.cpp    (working copy)
@@ -608,11 +608,12 @@
 
 void ToDoListView::OnDoubleClick( wxCommandEvent& event )
 {    // pecan 1/2/2006 12PM : Switched with OnListItemSelected by Rick 20/07/2007
-    long idx = control->GetNextItem(-1,
+    long item = control->GetNextItem(-1,
                                      wxLIST_NEXT_ALL,
                                      wxLIST_STATE_SELECTED);
-    if (idx == -1)
+    if (item == -1)
         return;
+    long idx = control->GetItemData(item);
 
     wxString file = m_Items[idx].filename;
     long int line = m_Items[idx].line;
tpetrov 2009-12-22 21:50

steps to reproduce the bug:

1. open the C::B project

2. view -> TODO

3. select all files

4. select user

5. double click on the first item