summaryrefslogtreecommitdiff
path: root/indra/newview/llexpandabletextbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llexpandabletextbox.cpp')
-rw-r--r--indra/newview/llexpandabletextbox.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp
index 4c105176b6..5c46eb9d80 100644
--- a/indra/newview/llexpandabletextbox.cpp
+++ b/indra/newview/llexpandabletextbox.cpp
@@ -41,9 +41,17 @@ public:
: LLTextSegment(start, end),
mEditor(editor),
mStyle(style),
- mExpanderLabel(more_text)
+ mExpanderLabel(utf8str_to_wstring(more_text))
{}
+ /*virtual*/ LLTextSegmentPtr clone(LLTextBase& target) const
+ {
+ LLStyleSP sp(cloneStyle(target, mStyle));
+ LLExpanderSegment* copy = new LLExpanderSegment(sp, mStart, mEnd, LLStringUtil::null, target);
+ copy->mExpanderLabel = mExpanderLabel;
+ return copy;
+ }
+
/*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const
{
// more label always spans width of text box
@@ -54,7 +62,7 @@ public:
}
else
{
- width = mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad();
+ width = (F32)(mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad());
height = mStyle->getFont()->getLineHeight();
}
return true;
@@ -80,13 +88,13 @@ public:
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect)
{
F32 right_x;
- mStyle->getFont()->renderUTF8(mExpanderLabel, start,
+ mStyle->getFont()->render(mExpanderLabel, start,
draw_rect.mRight, draw_rect.mTop,
mStyle->getColor(),
LLFontGL::RIGHT, LLFontGL::TOP,
0,
mStyle->getShadowType(),
- end - start, draw_rect.getWidth(),
+ end - start, (S32)draw_rect.getWidth(),
&right_x,
mEditor.getUseEllipses(), mEditor.getUseColor());
return right_x;
@@ -103,7 +111,7 @@ public:
private:
LLTextBase& mEditor;
LLStyleSP mStyle;
- std::string mExpanderLabel;
+ LLWString mExpanderLabel;
};
LLExpandableTextBox::LLTextBoxEx::Params::Params()