summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorangela <angela@lindenlab.com>2009-11-12 21:17:31 +0800
committerangela <angela@lindenlab.com>2009-11-12 21:17:31 +0800
commitb1a81afef6395e136f26e296311ec9b57eef260e (patch)
treea20f0d5f917fe6003d84d3ddb2db17e63b9677c7 /indra/llui
parentd1f8328b1e3bc17b920dfc3f8bc1865dff19d039 (diff)
add optional style params in setText function
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp4
-rw-r--r--indra/llui/lltextbase.h2
-rw-r--r--indra/llui/lltextbox.cpp4
-rw-r--r--indra/llui/lltextbox.h2
-rw-r--r--indra/llui/lltexteditor.cpp4
-rw-r--r--indra/llui/lltexteditor.h2
6 files changed, 9 insertions, 9 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