another attempt at lluistring cleanup

meow-7.2.2
Richard Linden 2010-10-15 14:37:00 -07:00
parent c4ec141cc0
commit 6357806dd0
2 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;