diff options
author | Richard Linden <none@none> | 2010-10-15 14:37:00 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-10-15 14:37:00 -0700 |
commit | 6357806dd0d4f70822ba6aa453efbe3a54dc32af (patch) | |
tree | b0b585f3066b75a8aa1c9593e9a995e4fd391c86 /indra | |
parent | c4ec141cc0e2de055d6eff10727fd33ae6767d98 (diff) |
another attempt at lluistring cleanup
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; |