fixing bug 130982 - delete/move context menu command attempts to restore focus to invalid row. r=bhuvan sr=sspitzer

This commit is contained in:
ssu%netscape.com 2002-03-16 03:12:58 +00:00
Родитель f2241ba056
Коммит abd5d148c5
3 изменённых файлов: 7 добавлений и 0 удалений

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

@ -34,6 +34,8 @@ function RestoreSelectionWithoutContentLoad(outliner)
var outlinerBoxObj = outliner.outlinerBoxObject;
var outlinerSelection = outlinerBoxObj.selection;
// make sure that currentIndex is valid so that we don't try to restore
// a selection of an invalid row.
if((!outlinerSelection.isSelected(outlinerSelection.currentIndex)) &&
(outlinerSelection.currentIndex >= 0))
{

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

@ -900,6 +900,8 @@ function ChangeSelectionWithoutContentLoad(event, outliner)
var outlinerSelection = outlinerBoxObj.selection;
outlinerBoxObj.getCellAt(event.clientX, event.clientY, row, col, elt);
// make sure that row.value is valid so that it doesn't mess up
// the call to ensureRowIsVisible().
if((row.value >= 0) && !outlinerSelection.isSelected(row.value))
{
var saveCurrentIndex = outlinerSelection.currentIndex;

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

@ -305,6 +305,9 @@ function GetThreadPaneFolder()
function EnsureRowInThreadOutlinerIsVisible(index)
{
if (index < 0)
return;
var outliner = GetThreadOutliner();
outliner.boxObject.QueryInterface(Components.interfaces.nsIOutlinerBoxObject).ensureRowIsVisible(index);
}