diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/lluistring.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lluistring.h | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/indra/llui/lluistring.cpp b/indra/llui/lluistring.cpp index d805e37c09..ac69d3bf85 100644 --- a/indra/llui/lluistring.cpp +++ b/indra/llui/lluistring.cpp @@ -129,7 +129,7 @@ void LLUIString::updateResult() const mResult = mOrig; // get the defailt args + local args - if (!mArgs.get() || mArgs->empty()) + if (!mArgs || mArgs->empty()) { LLStringUtil::format(mResult, LLTrans::getDefaultArgs()); } @@ -150,7 +150,7 @@ void LLUIString::updateWResult() const LLStringUtil::format_map_t& LLUIString::getArgs() { - if (!mArgs.get()) + if (!mArgs) { mArgs = new LLStringUtil::format_map_t; } diff --git a/indra/llui/lluistring.h b/indra/llui/lluistring.h index d7be3b1800..86457a8b25 100644 --- a/indra/llui/lluistring.h +++ b/indra/llui/lluistring.h @@ -61,6 +61,7 @@ public: LLUIString() : mArgs(NULL), mNeedsResult(false), mNeedsWResult(false) {} LLUIString(const std::string& instring, const LLStringUtil::format_map_t& args); LLUIString(const std::string& instring) : mArgs(NULL) { assign(instring); } + ~LLUIString() { delete mArgs; } void assign(const std::string& instring); LLUIString& operator=(const std::string& s) { assign(s); return *this; } @@ -80,7 +81,7 @@ public: S32 length() const { return getUpdatedWResult().size(); } void clear(); - void clearArgs() { if (mArgs.get()) mArgs->clear(); } + void clearArgs() { if (mArgs) mArgs->clear(); } // These utility functions are included for text editing. // They do not affect mOrig and do not perform argument substitution @@ -104,7 +105,7 @@ private: std::string mOrig; mutable std::string mResult; mutable LLWString mWResult; // for displaying - std::auto_ptr<LLStringUtil::format_map_t> mArgs; + LLStringUtil::format_map_t* mArgs; // controls lazy evaluation mutable bool mNeedsResult; |