From b52c7c5943152ba59bf958a76db763ec3c36b789 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sun, 12 Jun 2011 02:27:17 +0000 Subject: [PATCH] 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 --- src/kits/interface/ListView.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 14e6f5786f..4007a09f00 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -1022,10 +1022,7 @@ BListView::ScrollToSelection() if (Bounds().Contains(itemFrame)) return; - if (itemFrame.top < Bounds().top) - ScrollTo(itemFrame.left, itemFrame.top); - else - ScrollTo(itemFrame.left, itemFrame.bottom - Bounds().Height()); + ScrollTo(itemFrame.left, itemFrame.top); } @@ -1801,7 +1798,7 @@ BListView::_RescanSelection(int32 from, int32 to) from = max_c(0, from); to = min_c(to, CountItems() - 1); - + if (fAnchorIndex != -1) { if (fAnchorIndex == from) fAnchorIndex = to; @@ -1818,7 +1815,7 @@ BListView::_RescanSelection(int32 from, int32 to) if (fFirstSelected > from) from = fFirstSelected; - + fLastSelected = fFirstSelected; for (int32 i = from; i <= to; i++) { if (ItemAt(i)->IsSelected())