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

git-svn-id: svn://10.0.0.236/trunk@144188 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2003-06-26 10:54:42 +00:00
parent 19172444de
commit 5786ecfe29

View File

@@ -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)