Problem: 1615666
Title: (TTextListView -DoKeySelection) Wrong for empty list
Received: Dec 27 1996 1:15PM
void TTextListView::DoKeySelection(const CStr255& selectionString) { CStr255 itemText; short itemIndex; short lastItemIndex = GetItemIndexOrdered(1); for (short i = 1; i <= fNumOfRows; i++) { itemIndex = GetItemIndexOrdered(i); GetItemText(itemIndex, itemText); itemText.Delete(selectionString.Length() + 1, itemText.Length() - selectionString.Length()); lastItemIndex = itemIndex; if (itemText >= selectionString) break; } this->SelectItem(lastItemIndex, FALSE, TRUE, TRUE); this->ScrollSelectionIntoView(TRUE); } // TTextListView::DoKeySelection
UGridView.cp: Added a test of fNumOfRows inside TTextListView::DoKeySelection that shortcircuits the entire function if there are no rows in the list.