From 66fee67397d17f03ac5492a903735e2e6eef9f1f Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 12 Dec 2012 09:22:14 -0500 Subject: MAINT-2051: Implement replacement of an existing autoreplace list --- indra/newview/llautoreplace.cpp | 40 ++++++++++++++++++++++++++ indra/newview/llautoreplace.h | 3 ++ indra/newview/llfloaterautoreplacesettings.cpp | 17 +++++++++-- 3 files changed, 57 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp index 0f1ce2bcd0..d71cf290d6 100644 --- a/indra/newview/llautoreplace.cpp +++ b/indra/newview/llautoreplace.cpp @@ -536,6 +536,46 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::addList(const LLSD& return result; } +LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::replaceList(const LLSD& newList) +{ + AddListResult result = AddListInvalidList; + if ( listIsValid( newList ) ) + { + std::string listName = newList[AUTOREPLACE_LIST_NAME].asString(); + bool listFound = false; + S32 search_index; + LLSD targetList; + // The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30 + for ( search_index = 0, targetList = mLists[0]; + !listFound && search_index < mLists.size(); + search_index += 1, targetList = mLists[search_index] + ) + { + if ( targetList.isMap() ) + { + if ( listNameMatches( targetList, listName) ) + { + LL_DEBUGS("AutoReplace")<<"list to replace found at "<