Remove unnecessary calculations from BListView::ScrollToSelection(). At least I

see no useful purpose to the distinction made here.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42120 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2011-06-12 02:27:17 +00:00
parent 6b0007fb77
commit b52c7c5943
+3 -6
View File
@@ -1022,10 +1022,7 @@ BListView::ScrollToSelection()
if (Bounds().Contains(itemFrame)) if (Bounds().Contains(itemFrame))
return; return;
if (itemFrame.top < Bounds().top) ScrollTo(itemFrame.left, itemFrame.top);
ScrollTo(itemFrame.left, itemFrame.top);
else
ScrollTo(itemFrame.left, itemFrame.bottom - Bounds().Height());
} }
@@ -1801,7 +1798,7 @@ BListView::_RescanSelection(int32 from, int32 to)
from = max_c(0, from); from = max_c(0, from);
to = min_c(to, CountItems() - 1); to = min_c(to, CountItems() - 1);
if (fAnchorIndex != -1) { if (fAnchorIndex != -1) {
if (fAnchorIndex == from) if (fAnchorIndex == from)
fAnchorIndex = to; fAnchorIndex = to;
@@ -1818,7 +1815,7 @@ BListView::_RescanSelection(int32 from, int32 to)
if (fFirstSelected > from) if (fFirstSelected > from)
from = fFirstSelected; from = fFirstSelected;
fLastSelected = fFirstSelected; fLastSelected = fFirstSelected;
for (int32 i = from; i <= to; i++) { for (int32 i = from; i <= to; i++) {
if (ItemAt(i)->IsSelected()) if (ItemAt(i)->IsSelected())