diff options
| author | Oz Linden <oz@lindenlab.com> | 2010-10-14 14:13:30 -0400 |
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2010-10-14 14:13:30 -0400 |
| commit | ac3f7c2b6b72aa955c0aa1337b8f25c6f097b429 (patch) | |
| tree | d5954adeccf8ef19e66cdc8275521a5ea195e3cb /indra/llui/lluistring.cpp | |
| parent | 1bd19e8ffe99c4a2d0df8936bf01a63ebc05258f (diff) | |
| parent | 7ea2a1f9cc998396f437ec2535ddb1d51cce46b1 (diff) | |
Automated merge with file:///Users/oz/Work/viewer-beta
Diffstat (limited to 'indra/llui/lluistring.cpp')
| -rw-r--r-- | indra/llui/lluistring.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index 3e9b956ee6..ac69d3bf85 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -34,7 +34,7 @@ LLFastTimer::DeclareTimer FTM_UI_STRING("UI String"); LLUIString::LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args) : mOrig(instring), - mArgs(args) + mArgs(new LLStringUtil::format_map_t(args)) { dirty(); } @@ -48,7 +48,7 @@ void LLUIString::assign(const std::string& s) void LLUIString::setArgList(const LLStringUtil::format_map_t& args) { - mArgs = args; + getArgs() = args; dirty(); } @@ -68,7 +68,7 @@ void LLUIString::setArgs(const LLSD& sd) void LLUIString::setArg(const std::string& key, const std::string& replacement) { - mArgs[key] = replacement; + getArgs()[key] = replacement; dirty(); } @@ -129,14 +129,14 @@ void LLUIString::updateResult() const mResult = mOrig; // get the defailt args + local args - if (mArgs.empty()) + if (!mArgs || mArgs->empty()) { LLStringUtil::format(mResult, LLTrans::getDefaultArgs()); } else { LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs(); - combined_args.insert(mArgs.begin(), mArgs.end()); + combined_args.insert(mArgs->begin(), mArgs->end()); LLStringUtil::format(mResult, combined_args); } } @@ -147,3 +147,12 @@ void LLUIString::updateWResult() const mWResult = utf8str_to_wstring(getUpdatedResult()); } + +LLStringUtil::format_map_t& LLUIString::getArgs() +{ + if (!mArgs) + { + mArgs = new LLStringUtil::format_map_t; + } + return *mArgs; +} |
