Fix off-by-one error when adding new rows from external rdf containers. (rev scc, appr don)

This commit is contained in:
pinkerton 1998-05-05 21:21:43 +00:00
Родитель bf0417269d
Коммит ee7e040819
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -250,9 +250,14 @@ void CRDFCoordinator::HandleNotification(
{
case HT_EVENT_NODE_ADDED:
{
if ( view == mTreePane->GetHTView() ) {
if ( view == mTreePane->GetHTView() ) {
// HT_GetNodeIndex() will return the row where this new item should go
// in a zero-based world. This translates, in a 1-based world of PP, to be
// the node after which this new row will go. Conveniently, that is what
// we want for InsertRows() so we don't have to add 1 like we normally do
// when coverting between HT and PP.
TableIndexT index = HT_GetNodeIndex(view, node);
mTreePane->InsertRows(1, index + 1, NULL, 0, true);
mTreePane->InsertRows(1, index, NULL, 0, true);
mTreePane->SyncSelectionWithHT();
}
break;