summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-04-30 19:08:31 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-04-30 19:08:31 +0300
commit05c662528a6754d2d1c15d39c7605945c2b776e2 (patch)
tree4ffa7bee8100a343a0d3349c12b5f32ecab78654 /indra/newview/llcofwearables.cpp
parent9fda462330692dafc66f1b47d67c5378cf4e3552 (diff)
parentd6edc4cd12c015003cd665028b69a7b34b3aa54f (diff)
merge
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r--indra/newview/llcofwearables.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index 36a8031cce..1925b818f2 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -94,6 +94,16 @@ void LLCOFWearables::onSelectionChange(LLFlatListView* selected_list)
void LLCOFWearables::refresh()
{
+ typedef std::vector<LLSD> values_vector_t;
+ typedef std::map<LLFlatListView*, values_vector_t> selection_map_t;
+
+ selection_map_t preserve_selection;
+
+ // Save current selection
+ mAttachments->getSelectedValues(preserve_selection[mAttachments]);
+ mClothing->getSelectedValues(preserve_selection[mClothing]);
+ mBodyParts->getSelectedValues(preserve_selection[mBodyParts]);
+
clear();
LLInventoryModel::cat_array_t cats;
@@ -108,6 +118,23 @@ void LLCOFWearables::refresh()
LLAppearanceMgr::getInstance()->divvyWearablesByType(cof_items, clothing_by_type);
populateClothingList(clothing_by_type);
+
+ // Restore previous selection
+ for (selection_map_t::iterator
+ iter = preserve_selection.begin(),
+ iter_end = preserve_selection.end();
+ iter != iter_end; ++iter)
+ {
+ LLFlatListView* list = iter->first;
+ const values_vector_t& values = iter->second;
+ for (values_vector_t::const_iterator
+ value_it = values.begin(),
+ value_it_end = values.end();
+ value_it != value_it_end; ++value_it)
+ {
+ list->selectItemByValue(*value_it);
+ }
+ }
}