summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.cpp
diff options
context:
space:
mode:
authorAndrew Meadows <andrew@lindenlab.com>2010-10-11 10:40:05 -0700
committerAndrew Meadows <andrew@lindenlab.com>2010-10-11 10:40:05 -0700
commit92a8d93b0d3084c1ccd4fb9cccc285bc14d01404 (patch)
treea07a9cba41f8609a6cfc6449877ca5c2d6ddfdd9 /indra/newview/llcofwearables.cpp
parentc2f5bc0b129e0e0d2606a8e7849bbf37eb0276ea (diff)
parent48c2b2496d3ed6aeeebb0bc8950725f8ef7e305f (diff)
Another merge from http://hg.secondlife.com/viewer-development
Diffstat (limited to 'indra/newview/llcofwearables.cpp')
-rw-r--r--indra/newview/llcofwearables.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index b1e11e1a2a..84c560639e 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -397,12 +397,20 @@ void LLCOFWearables::refresh()
mCOFVersion = catp->getVersion();
+ // Save current scrollbar position.
+ typedef std::map<LLFlatListView*, LLRect> scroll_pos_map_t;
+ scroll_pos_map_t saved_scroll_pos;
+
+ saved_scroll_pos[mAttachments] = mAttachments->getVisibleContentRect();
+ saved_scroll_pos[mClothing] = mClothing->getVisibleContentRect();
+ saved_scroll_pos[mBodyParts] = mBodyParts->getVisibleContentRect();
+
+ // Save current selection.
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]);
@@ -450,6 +458,15 @@ void LLCOFWearables::refresh()
list->setCommitOnSelectionChange(true);
}
+
+ // Restore previous scrollbar position.
+ for (scroll_pos_map_t::const_iterator it = saved_scroll_pos.begin(); it != saved_scroll_pos.end(); ++it)
+ {
+ LLFlatListView* list = it->first;
+ LLRect scroll_pos = it->second;
+
+ list->scrollToShowRect(scroll_pos);
+ }
}