summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistctrl.cpp
diff options
context:
space:
mode:
authorDon Kjer <don@lindenlab.com>2007-11-09 01:56:15 +0000
committerDon Kjer <don@lindenlab.com>2007-11-09 01:56:15 +0000
commitc1920e3c1c60fb792cf091750b05de618b355878 (patch)
tree204b78e0f0b87fb2875b90af0f579d53e3138cbb /indra/llui/llscrolllistctrl.cpp
parent760f2ceb1518d87e865f25ac87a540625e974517 (diff)
EFFECTIVE MERGE: svn merge -r 70833:71458 svn+ssh://svn/svn/linden/branches/maintenance-2 into release
ACTUAL MERGE: svn merge -r 73210:73222 svn+ssh://svn/svn/linden/qa/maintenance-2-merge-73206 into release
Diffstat (limited to 'indra/llui/llscrolllistctrl.cpp')
-rw-r--r--indra/llui/llscrolllistctrl.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index f5eef29dcb..96a739418f 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -701,7 +701,7 @@ BOOL LLScrollListCtrl::addItem( LLScrollListItem* item, EAddPosition pos )
break;
}
- updateLineHeight();
+ updateLineHeightInsert(item);
mPageLines = mLineHeight ? mItemListRect.getHeight() / mLineHeight : 0;
BOOL scrollbar_visible = mPageLines < getItemCount();
@@ -753,12 +753,11 @@ void LLScrollListCtrl::updateMaxContentWidth(LLScrollListItem* added_item)
}
}
+const S32 SCROLL_LIST_ROW_PAD = 2;
// Line height is the max height of all the cells in all the items.
void LLScrollListCtrl::updateLineHeight()
{
- const S32 ROW_PAD = 2;
-
mLineHeight = 0;
item_list::iterator iter;
for (iter = mItemList.begin(); iter != mItemList.end(); iter++)
@@ -768,11 +767,23 @@ void LLScrollListCtrl::updateLineHeight()
S32 i = 0;
for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i))
{
- mLineHeight = llmax( mLineHeight, cell->getHeight() + ROW_PAD );
+ mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD );
}
}
}
+// when the only change to line height is from an insert, we needn't scan the entire list
+void LLScrollListCtrl::updateLineHeightInsert(LLScrollListItem* itemp)
+{
+ S32 num_cols = itemp->getNumColumns();
+ S32 i = 0;
+ for (const LLScrollListCell* cell = itemp->getColumn(i); i < num_cols; cell = itemp->getColumn(++i))
+ {
+ mLineHeight = llmax( mLineHeight, cell->getHeight() + SCROLL_LIST_ROW_PAD );
+ }
+}
+
+
void LLScrollListCtrl::updateColumns()
{
mColumnsIndexed.resize(mColumns.size());