Bug 210638 Tree should be able to maintain the selection during a batch update r=varga sr=jag

This commit is contained in:
neil%parkwaycc.co.uk 2003-06-26 10:54:42 +00:00
Родитель ce6fe2f543
Коммит af1b41e03b
1 изменённых файлов: 7 добавлений и 7 удалений

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

@ -1708,22 +1708,22 @@ nsTreeBodyFrame::CreateTimer(const nsILookAndFeel::nsMetricID aID,
NS_IMETHODIMP nsTreeBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCount)
{
if (mUpdateBatchNest)
return NS_OK;
if (aCount == 0 || !mView)
return NS_OK; // Nothing to do.
PRInt32 count = PR_ABS(aCount);
PRInt32 rowCount;
mView->GetRowCount(&rowCount);
// Adjust our selection.
nsCOMPtr<nsITreeSelection> sel;
mView->GetSelection(getter_AddRefs(sel));
if (sel)
sel->AdjustSelection(aIndex, aCount);
if (mUpdateBatchNest)
return NS_OK;
PRInt32 count = PR_ABS(aCount);
PRInt32 rowCount;
mView->GetRowCount(&rowCount);
PRInt32 last;
GetLastVisibleRow(&last);
if (aIndex >= mTopRowIndex && aIndex <= last)