From 9fdca96f8bd2211a99fe88e57b70cbecefa20b6d Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 8 Jul 2024 20:27:14 +0200 Subject: Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now --- indra/newview/llexpandabletextbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llexpandabletextbox.cpp') diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 4c105176b6..42fe8fc6e6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -54,7 +54,7 @@ public: } else { - width = mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad(); + width = (F32)(mEditor.getDocumentView()->getRect().getWidth() - mEditor.getHPad()); height = mStyle->getFont()->getLineHeight(); } return true; @@ -86,7 +86,7 @@ public: 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; -- cgit v1.2.3 From 604cb4cb4dd71c0f90633e50d5b0108e3901c4ad Mon Sep 17 00:00:00 2001 From: Rye Mutt Date: Fri, 26 Jul 2024 06:19:34 -0400 Subject: Reduce utf8 to wstring conversion and llwstring temporaries during text draw (#2115) --- indra/newview/llexpandabletextbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llexpandabletextbox.cpp') diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 42fe8fc6e6..748e10160c 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -41,7 +41,7 @@ public: : LLTextSegment(start, end), mEditor(editor), mStyle(style), - mExpanderLabel(more_text) + mExpanderLabel(utf8str_to_wstring(more_text)) {} /*virtual*/ bool getDimensionsF32(S32 first_char, S32 num_chars, F32& width, S32& height) const @@ -80,7 +80,7 @@ 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, @@ -103,7 +103,7 @@ public: private: LLTextBase& mEditor; LLStyleSP mStyle; - std::string mExpanderLabel; + LLWString mExpanderLabel; }; LLExpandableTextBox::LLTextBoxEx::Params::Params() -- cgit v1.2.3