diff options
author | angela <angela@lindenlab.com> | 2009-11-12 21:36:34 +0800 |
---|---|---|
committer | angela <angela@lindenlab.com> | 2009-11-12 21:36:34 +0800 |
commit | ff09b049a7916a73301bd02f9810994025d88e06 (patch) | |
tree | 2f2fe764116db1401fae342c1930be5e9a70a3e3 /indra/llui | |
parent | 6524295bf06f58fad84dc7251f6ba3fd81ce94f2 (diff) | |
parent | 11fc2da6fa5fba0bb659dd97f8533e4529aece06 (diff) |
merge
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltextbase.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 2 | ||||
-rw-r--r-- | indra/llui/lltextbox.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbox.h | 2 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltexteditor.h | 2 | ||||
-rw-r--r-- | indra/llui/lluicolortable.cpp | 10 |
7 files changed, 18 insertions, 10 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9706878a57..7b1aaac35c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1451,7 +1451,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) } } -void LLTextBase::setText(const LLStringExplicit &utf8str) +void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& input_params) { // clear out the existing text and segments getViewModel()->setDisplay(LLWStringUtil::null); @@ -1466,7 +1466,7 @@ void LLTextBase::setText(const LLStringExplicit &utf8str) std::string text(utf8str); LLStringUtil::removeCRLF(text); - appendText(text, false); + appendText(text, false, input_params); onValueChange(0, getLength()); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index fb01cd1e7c..70d78c77cd 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -137,7 +137,7 @@ public: // Text accessors // TODO: add optional style parameter - virtual void setText(const LLStringExplicit &utf8str); // uses default style + virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style virtual std::string getText() const; // wide-char versions diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 00f1d833a3..4c4123cf45 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -112,12 +112,12 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) return handled; } -void LLTextBox::setText(const LLStringExplicit& text) +void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) { // does string argument insertion mText.assign(text); - LLTextBase::setText(mText.getString()); + LLTextBase::setText(mText.getString(), input_params ); } void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 73f8a7c299..01b4bfa5ed 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -58,7 +58,7 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void setText( const LLStringExplicit& text ); + /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index d136c6b49d..224f066968 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -311,12 +311,12 @@ LLTextEditor::~LLTextEditor() // LLTextEditor // Public methods -void LLTextEditor::setText(const LLStringExplicit &utf8str) +void LLTextEditor::setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params) { blockUndo(); deselect(); - LLTextBase::setText(utf8str); + LLTextBase::setText(utf8str, input_params); resetDirty(); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 10fc94dedc..fb014b86bf 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -168,7 +168,7 @@ public: void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); // Non-undoable - void setText(const LLStringExplicit &utf8str); + void setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params = LLStyle::Params()); // Removes text from the end of document diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index f1e3000547..9be33483d0 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -192,19 +192,27 @@ void LLUIColorTable::clear() LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const { string_color_map_t::const_iterator iter = mUserSetColors.find(name); + if(iter != mUserSetColors.end()) { return LLUIColor(&iter->second); } iter = mLoadedColors.find(name); - return (iter != mLoadedColors.end() ? LLUIColor(&iter->second) : LLUIColor(default_color)); + + if(iter != mLoadedColors.end()) + { + return LLUIColor(&iter->second); + } + + return LLUIColor(default_color); } // update user color, loaded colors are parsed on initialization void LLUIColorTable::setColor(const std::string& name, const LLColor4& color) { setColor(name, color, mUserSetColors); + setColor(name, color, mLoadedColors); } bool LLUIColorTable::loadFromSettings() |