diff options
Diffstat (limited to 'indra/newview/llexpandabletextbox.cpp')
-rw-r--r--[-rwxr-xr-x] | indra/newview/llexpandabletextbox.cpp | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index f2602c8c7d..f0331f20d8 100755..100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -77,7 +77,7 @@ public: return 0; } } - /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) + /*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, @@ -122,8 +122,6 @@ LLExpandableTextBox::LLTextBoxEx::LLTextBoxEx(const Params& p) void LLExpandableTextBox::LLTextBoxEx::reshape(S32 width, S32 height, BOOL called_from_parent) { LLTextEditor::reshape(width, height, called_from_parent); - - hideOrShowExpandTextAsNeeded(); } void LLExpandableTextBox::LLTextBoxEx::setText(const LLStringExplicit& text,const LLStyle::Params& input_params) @@ -237,6 +235,7 @@ LLExpandableTextBox::LLExpandableTextBox(const Params& p) LLTextBoxEx::Params textbox_params = p.textbox; textbox_params.rect(rc); mTextBox = LLUICtrlFactory::create<LLTextBoxEx>(textbox_params); + mTextBox->setContentTrusted(false); mScroll->addChild(mTextBox); updateTextBoxRect(); @@ -260,6 +259,11 @@ void LLExpandableTextBox::draw() LLUICtrl::draw(); } +void LLExpandableTextBox::setContentTrusted(bool trusted_content) +{ + mTextBox->setContentTrusted(trusted_content); +} + void LLExpandableTextBox::collapseIfPosChanged() { if(mExpanded) @@ -292,6 +296,12 @@ void LLExpandableTextBox::updateTextBoxRect() mTextBox->reshape(rc.getWidth(), rc.getHeight()); mTextBox->setRect(rc); + // *HACK + // hideExpandText brakes text styles (replaces hyper-links with plain text), see ticket EXT-3290 + // Also text segments are not removed properly. Same issue at expandTextBox(). + // So set text again to make text box re-apply styles and clear segments. + // *TODO Find a solution that does not involve text segment. + mTextBox->setText(mText); } S32 LLExpandableTextBox::recalculateTextDelta(S32 text_delta) @@ -397,8 +407,6 @@ void LLExpandableTextBox::collapseTextBox() setRect(mCollapsedRect); updateTextBoxRect(); - - gViewerWindow->removePopup(this); } void LLExpandableTextBox::onFocusLost() @@ -417,13 +425,19 @@ void LLExpandableTextBox::onTopLost() void LLExpandableTextBox::updateTextShape() { - // I guess this should be done on every reshape(), - // but adding this code to reshape() currently triggers bug VWR-26455, - // which makes the text virtually unreadable. llassert(!mExpanded); updateTextBoxRect(); } +void LLExpandableTextBox::reshape(S32 width, S32 height, BOOL called_from_parent) +{ + mExpanded = false; + LLUICtrl::reshape(width, height, called_from_parent); + updateTextBoxRect(); + + gViewerWindow->removePopup(this); +} + void LLExpandableTextBox::setValue(const LLSD& value) { collapseTextBox(); |