summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistctrl.cpp
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
committerAdam Moss <moss@lindenlab.com>2009-04-16 23:45:35 +0000
commitb01c75cb423f07a3d3354f8bd62f265f80062b3b (patch)
treedec1b220c24a60cc220d1cb07fd3545610644f0a /indra/llui/llscrolllistctrl.cpp
parent868250bdd74f348557102c0d8408d9bec30331f6 (diff)
svn merge -r117314:117337
svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/mv13a-merge-1 QAR-1343 maint-viewer-13a+libcurlexploitfix-3-3 combo merge
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r--indra/llui/llscrolllistctrl.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 7b6c125eb1..5dd4e2d0ee 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -835,6 +835,12 @@ void LLScrollListCtrl::updateLayout()
mItemListRect.mRight = getRect().getWidth() - mBorderThickness - SCROLLBAR_SIZE;
}
+ // don't allow scrolling off bottom
+ if (mScrollLines + mPageLines > getItemCount())
+ {
+ setScrollPos(llmax(0, getItemCount() - mPageLines));
+ }
+
mScrollbar->reshape(SCROLLBAR_SIZE, mItemListRect.getHeight() + (mDisplayColumnHeaders ? mHeadingHeight : 0));
mScrollbar->setPageSize( mPageLines );
mScrollbar->setDocSize( getItemCount() );
@@ -2663,6 +2669,11 @@ void LLScrollListCtrl::scrollToShowSelected()
return;
}
+ if (needsSorting() && !isSorted())
+ {
+ sortItems();
+ }
+
S32 index = getFirstSelectedIndex();
if (index < 0)
{