Bug 80543 -- outliner RowCountChanged behaving incorrectly on row removal. r=sspitzer, sr=hyatt.

This commit is contained in:
bryner%uiuc.edu 2001-05-15 19:44:23 +00:00
parent 1f8f87f711
commit b1fd88de8e
2 changed files with 8 additions and 6 deletions

View File

@ -1179,13 +1179,14 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
else if (aCount < 0) {
if (mTopRowIndex > aIndex+count-1) {
// No need to invalidate. The remove happened
// completely offscreen.
// completely above us (offscreen).
mTopRowIndex -= count;
UpdateScrollbar();
}
else if (mTopRowIndex > aIndex) {
else if (mTopRowIndex >= aIndex) {
// This is a full-blown invalidate.
mTopRowIndex = aIndex+count-1;
if (mTopRowIndex + mPageCount > rowCount - 1)
mTopRowIndex = PR_MAX(0, rowCount - 1 - mPageCount);
UpdateScrollbar();
Invalidate();
}

View File

@ -1179,13 +1179,14 @@ NS_IMETHODIMP nsOutlinerBodyFrame::RowCountChanged(PRInt32 aIndex, PRInt32 aCoun
else if (aCount < 0) {
if (mTopRowIndex > aIndex+count-1) {
// No need to invalidate. The remove happened
// completely offscreen.
// completely above us (offscreen).
mTopRowIndex -= count;
UpdateScrollbar();
}
else if (mTopRowIndex > aIndex) {
else if (mTopRowIndex >= aIndex) {
// This is a full-blown invalidate.
mTopRowIndex = aIndex+count-1;
if (mTopRowIndex + mPageCount > rowCount - 1)
mTopRowIndex = PR_MAX(0, rowCount - 1 - mPageCount);
UpdateScrollbar();
Invalidate();
}