diff --git a/checkin_notes b/checkin_notes index 169b29b7ad..d918f9f5dc 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8374,3 +8374,12 @@ Charlie 9 Nov 2011 cs_cmdline.cpp clientgui/ BOINCGUIApp.cpp + +Charlie 11 Nov 2011 + - Mgr: fix a bug deleting entries from Task Selection control which I + introduced on 9 November. Deleting an entry cvan create a gap in + the alphabetically sorted sequence, so we can't use my earlier + shortcut in checking for existing entries. + + clientgui/ + sg_TaskPanel.cpp diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp index 79fe208c83..a6323ed039 100755 --- a/clientgui/sg_TaskPanel.cpp +++ b/clientgui/sg_TaskPanel.cpp @@ -736,26 +736,28 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) { is_alive.at(j) = true; break; // skip out of this loop } - alphaOrder = (m_TaskSelectionCtrl->GetString(j)).Cmp(resname); -#if SORTTASKLIST - if (alphaOrder > 0) { - break; // Insert the new item here (sorted by item label) - } -#endif - // wxComboBox and wxBitmapComboBox have bugs on Windows when multiple - // entries have identical text, so add enough spaces to make each - // entry's text unique. - if (alphaOrder == 0) { - resname.Append((const wxChar *)wxT(" ")); -#if !SORTTASKLIST - j = -1; // If not sorted, check new name from start for duplicate -#endif - continue; - } } // if it isn't currently in the list then we have a new one! lets add it if (!found) { + for(j = 0; j < count; ++j) { + alphaOrder = (m_TaskSelectionCtrl->GetString(j)).Cmp(resname); +#if SORTTASKLIST + if (alphaOrder > 0) { + break; // Insert the new item here (sorted by item label) + } +#endif + // wxComboBox and wxBitmapComboBox have bugs on Windows when multiple + // entries have identical text, so add enough spaces to make each + // entry's text unique. + if (alphaOrder == 0) { + resname.Append((const wxChar *)wxT(" ")); +#if !SORTTASKLIST + j = -1; // If not sorted, check new name from start for duplicate +#endif + } + } + selData = new TaskSelectionData; selData->result = result; strncpy(selData->result_name, result->name, sizeof(selData->result_name)); @@ -785,8 +787,8 @@ void CSimpleTaskPanel::UpdateTaskSelectionList(bool reskin) { is_alive.push_back(true); } ++count; - } - } + } // End if (!found) + } // End for (i) loop // Check items in descending order so deletion won't change indexes of items yet to be checked for(j = count-1; j >=0; --j) {