diff options
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
-rw-r--r-- | indra/llui/llflatlistview.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index e9df361472..bba5464b00 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -44,6 +44,9 @@ const LLSD UNSELECTED_EVENT = LLSD().insert("selected", false); static const std::string COMMENT_TEXTBOX = "comment_text"; +//forward declaration +bool llsds_are_equal(const LLSD& llsd_1, const LLSD& llsd_2); + LLFlatListView::Params::Params() : item_pad("item_pad"), allow_select("allow_select"), @@ -333,6 +336,17 @@ void LLFlatListView::sort() rearrangeItems(); } +bool LLFlatListView::updateValue(const LLSD& old_value, const LLSD& new_value) +{ + if (old_value.isUndefined() || new_value.isUndefined()) return false; + if (llsds_are_equal(old_value, new_value)) return false; + + item_pair_t* item_pair = getItemPair(old_value); + if (!item_pair) return false; + + item_pair->second = new_value; + return true; +} ////////////////////////////////////////////////////////////////////////// // PROTECTED STUFF |