From 72c1a2dd70530e7ffb83286b00e266bbafb3d3ac Mon Sep 17 00:00:00 2001 From: pinkerton Date: Tue, 5 May 1998 21:21:43 +0000 Subject: [PATCH] Fix off-by-one error when adding new rows from external rdf containers. (rev scc, appr don) git-svn-id: svn://10.0.0.236/trunk@1157 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/cmd/macfe/rdfui/CRDFCoordinator.cp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mozilla/cmd/macfe/rdfui/CRDFCoordinator.cp b/mozilla/cmd/macfe/rdfui/CRDFCoordinator.cp index c07909f8ffc..a453c49c9f2 100644 --- a/mozilla/cmd/macfe/rdfui/CRDFCoordinator.cp +++ b/mozilla/cmd/macfe/rdfui/CRDFCoordinator.cp @@ -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;