diff options
author | angela <angela@lindenlab.com> | 2009-11-12 21:17:31 +0800 |
---|---|---|
committer | angela <angela@lindenlab.com> | 2009-11-12 21:17:31 +0800 |
commit | b1a81afef6395e136f26e296311ec9b57eef260e (patch) | |
tree | a20f0d5f917fe6003d84d3ddb2db17e63b9677c7 | |
parent | d1f8328b1e3bc17b920dfc3f8bc1865dff19d039 (diff) |
add optional style params in setText function
-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/newview/llchatmsgbox.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llchatmsgbox.h | 2 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llexpandabletextbox.h | 2 |
10 files changed, 15 insertions, 15 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 8d36c9c616..49bd3a2a19 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1445,7 +1445,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); @@ -1460,7 +1460,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 8cae8fde22..d422f1cc8b 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -135,7 +135,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/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index 12626e3b43..bb0ec2db27 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -84,7 +84,7 @@ LLChatMsgBox::LLChatMsgBox(const Params& p) : mBlockSpacing(p.block_spacing) {} -void LLChatMsgBox::addText( const LLStringExplicit& text ) +void LLChatMsgBox::addText( const LLStringExplicit& text , const LLStyle::Params& input_params ) { S32 length = getLength(); // if there is existing text, add a separator @@ -94,5 +94,5 @@ void LLChatMsgBox::addText( const LLStringExplicit& text ) insertSegment(new ChatSeparator(length - 1, length - 1)); } // prepend newline only if there is some existing text - appendText(text, length > 0); + appendText(text, length > 0, input_params); } diff --git a/indra/newview/llchatmsgbox.h b/indra/newview/llchatmsgbox.h index df29db58c3..9e16616729 100644 --- a/indra/newview/llchatmsgbox.h +++ b/indra/newview/llchatmsgbox.h @@ -61,7 +61,7 @@ protected: friend class LLUICtrlFactory; public: - void addText(const LLStringExplicit &text); + void addText(const LLStringExplicit &text, const LLStyle::Params& input_params = LLStyle::Params()); private: S32 mBlockSpacing; diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 424d635321..6d7da107ac 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -129,12 +129,12 @@ void LLExpandableTextBox::LLTextBoxEx::reshape(S32 width, S32 height, BOOL calle } } -void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text) +void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,const LLStyle::Params& input_params) { // LLTextBox::setText will obliterate the expander segment, so make sure // we generate it again by clearing mExpanderVisible mExpanderVisible = false; - LLTextBox::setText(text); + LLTextBox::setText(text, input_params); // text contents have changed, segments are cleared out // so hide the expander and determine if we need it diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index 3fe646c29c..7c989cfa50 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -60,7 +60,7 @@ protected: // adds or removes "More" link as needed /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); - /*virtual*/ void setText(const LLStringExplicit& text); + /*virtual*/ void setText(const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params()); /** * Returns difference between text box height and text height. |