Remove the VerticalScroll() before layout, nsListBoxBodyFrame does that in its post reflow callback. b=547338 r=roc

This commit is contained in:
Mats Palmgren 2010-04-28 19:47:23 +02:00
Родитель f4d91f2af0
Коммит db44c31d90
1 изменённых файлов: 1 добавлений и 20 удалений

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

@ -130,26 +130,7 @@ nsListBoxLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
NS_IMETHODIMP
nsListBoxLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
{
nsListBoxBodyFrame* frame = static_cast<nsListBoxBodyFrame*>(aBox);
// Always ensure an accurate scrollview position
// This is an edge case that was caused by the row height
// changing after a scroll had occurred. (Bug #51084)
PRInt32 index;
frame->GetIndexOfFirstVisibleRow(&index);
if (index > 0) {
nscoord pos = frame->GetYPosition();
PRInt32 rowHeight = frame->GetRowHeightAppUnits();
if (pos != (rowHeight*index)) {
frame->VerticalScroll(rowHeight*index);
frame->Redraw(aState, nsnull, PR_FALSE);
}
}
nsresult rv = LayoutInternal(aBox, aState);
if (NS_FAILED(rv)) return rv;
return NS_OK;
return LayoutInternal(aBox, aState);
}