From 5786ecfe29160d54fbdcdb4b8691b7e03af5d2da Mon Sep 17 00:00:00 2001 From: "neil%parkwaycc.co.uk" Date: Thu, 26 Jun 2003 10:54:42 +0000 Subject: [PATCH] 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 --- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index ddd313e1684..717feeaa500 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -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 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)