зеркало из https://github.com/mozilla/gecko-dev.git
Bulletproofing the tree to not divide by 0 in the case of scrolling or
asking the row count of a 0-row tree. Bug 48306. r=syd.
This commit is contained in:
Родитель
641a62a2b5
Коммит
4ecd41805e
|
@ -921,7 +921,7 @@ nsXULTreeOuterGroupFrame::EnsureRowIsVisible(PRInt32 aRowIndex)
|
|||
void
|
||||
nsXULTreeOuterGroupFrame::ScrollToIndex(PRInt32 aRowIndex)
|
||||
{
|
||||
if ( aRowIndex < 0 )
|
||||
if (( aRowIndex < 0 ) || (mRowHeight == 0))
|
||||
return;
|
||||
|
||||
PRInt32 newIndex = aRowIndex;
|
||||
|
|
|
@ -142,7 +142,8 @@ public:
|
|||
nscoord GetYPosition();
|
||||
nscoord GetAvailableHeight();
|
||||
NS_IMETHOD GetNumberOfVisibleRows(PRInt32 *aResult) {
|
||||
*aResult=GetAvailableHeight() / mRowHeight; return NS_OK;
|
||||
*aResult=(mRowHeight ? GetAvailableHeight() / mRowHeight : 0);
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD GetIndexOfFirstVisibleRow(PRInt32 *aResult) {
|
||||
*aResult=mCurrentIndex; return NS_OK;
|
||||
|
|
Загрузка…
Ссылка в новой задаче