summaryrefslogtreecommitdiff
path: root/indra/llui/llflatlistview.cpp
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-10-10 23:18:41 +0200
committerAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2023-10-11 01:40:05 +0200
commit61a04f5ee1582d2d53874b8ef81a0e773df0fbfe (patch)
treea6780dda4236e91b21d7ee9657b951e8cb53d57c /indra/llui/llflatlistview.cpp
parentf576fae46ce9e46963c311aca7f60fd785c0a1e9 (diff)
SL-20288 Lags in Appearance floater (code format in LLAccordionCtrl)
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
-rw-r--r--indra/llui/llflatlistview.cpp52
1 files changed, 23 insertions, 29 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index b13e7389cc..460bd0945b 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -1198,7 +1198,7 @@ void LLFlatListView::onFocusReceived()
{
if (size())
{
- mSelectedItemsBorder->setVisible(TRUE);
+ mSelectedItemsBorder->setVisible(TRUE);
}
gEditMenuHandler = this;
}
@@ -1207,7 +1207,7 @@ void LLFlatListView::onFocusLost()
{
mSelectedItemsBorder->setVisible(FALSE);
// Route menu back to the default
- if( gEditMenuHandler == this )
+ if (gEditMenuHandler == this)
{
gEditMenuHandler = NULL;
}
@@ -1216,16 +1216,16 @@ void LLFlatListView::onFocusLost()
//virtual
S32 LLFlatListView::notify(const LLSD& info)
{
- if(info.has("action"))
+ if (info.has("action"))
{
std::string str_action = info["action"];
- if(str_action == "select_first")
+ if (str_action == "select_first")
{
setFocus(true);
selectFirstItem();
return 1;
}
- else if(str_action == "select_last")
+ else if (str_action == "select_last")
{
setFocus(true);
selectLastItem();
@@ -1238,6 +1238,7 @@ S32 LLFlatListView::notify(const LLSD& info)
notifyParentItemsRectChanged();
return 1;
}
+
return 0;
}
@@ -1249,10 +1250,8 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items)
detached_items.clear();
// Go through items and detach valid items, remove them from items panel
// and add to detached_items.
- for (pairs_iterator_t
- iter = mItemPairs.begin(),
- iter_end = mItemPairs.end();
- iter != iter_end; ++iter)
+ pairs_iterator_t iter = mItemPairs.begin(), iter_end = mItemPairs.end();
+ while (iter != iter_end)
{
LLPanel* pItem = (*iter)->first;
if (1 == pItem->notify(action))
@@ -1261,6 +1260,7 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items)
mItemsPanel->removeChild(pItem);
detached_items.push_back(pItem);
}
+ iter++;
}
if (!detached_items.empty())
{
@@ -1268,13 +1268,12 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items)
if (detached_items.size() == mItemPairs.size())
{
// This way will be faster if all items were disconnected
- for (pairs_iterator_t
- iter = mItemPairs.begin(),
- iter_end = mItemPairs.end();
- iter != iter_end; ++iter)
+ pairs_iterator_t iter = mItemPairs.begin(), iter_end = mItemPairs.end();
+ while (iter != iter_end)
{
(*iter)->first = NULL;
delete *iter;
+ iter++;
}
mItemPairs.clear();
// Also set items panel height to zero.
@@ -1287,16 +1286,14 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items)
}
else
{
- for (std::vector<LLPanel*>::const_iterator
- detached_iter = detached_items.begin(),
- detached_iter_end = detached_items.end();
- detached_iter != detached_iter_end; ++detached_iter)
+ std::vector<LLPanel*>::const_iterator
+ detached_iter = detached_items.begin(),
+ detached_iter_end = detached_items.end();
+ while (detached_iter < detached_iter_end)
{
LLPanel* pDetachedItem = *detached_iter;
- for (pairs_iterator_t
- iter = mItemPairs.begin(),
- iter_end = mItemPairs.end();
- iter != iter_end; ++iter)
+ pairs_iterator_t iter = mItemPairs.begin(), iter_end = mItemPairs.end();
+ while (iter != iter_end)
{
item_pair_t* item_pair = *iter;
if (item_pair->first == pDetachedItem)
@@ -1306,7 +1303,9 @@ void LLFlatListView::detachItems(std::vector<LLPanel*>& detached_items)
delete item_pair;
break;
}
+ iter++;
}
+ detached_iter++;
}
rearrangeItems();
}
@@ -1322,7 +1321,6 @@ LLFlatListViewEx::Params::Params()
: no_items_msg("no_items_msg")
, no_filtered_items_msg("no_filtered_items_msg")
{
-
}
LLFlatListViewEx::LLFlatListViewEx(const Params& p)
@@ -1332,7 +1330,6 @@ LLFlatListViewEx::LLFlatListViewEx(const Params& p)
, mForceShowingUnmatchedItems(false)
, mHasMatchedItems(false)
{
-
}
void LLFlatListViewEx::updateNoItemsMessage(const std::string& filter_string)
@@ -1352,7 +1349,6 @@ void LLFlatListViewEx::updateNoItemsMessage(const std::string& filter_string)
// list does not contain any items at all
setNoItemsCommentText(mNoItemsMsg);
}
-
}
bool LLFlatListViewEx::getForceShowingUnmatchedItems()
@@ -1411,12 +1407,10 @@ void LLFlatListViewEx::filterItems()
getItems(items);
mHasMatchedItems = false;
- for (item_panel_list_t::iterator
- iter = items.begin(),
- iter_end = items.end();
- iter != iter_end; ++iter)
+ item_panel_list_t::iterator iter = items.begin(), iter_end = items.end();
+ while (iter < iter_end)
{
- LLPanel* pItem = (*iter);
+ LLPanel* pItem = *(iter++);
updateItemVisibility(pItem, action);
}