From a33104ec5522352e23cdb788c003f830cd03cc1a Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Tue, 12 Feb 2013 19:26:24 -0800 Subject: CHUI-695: Viewer crash when accepting friend offer in conversations window. Problem was that LLIMToastNotifyPanel::snapToMessageHeight was calling LLToastPanel::reshape, which would then call LLIMToastNotifyPanel::reshape again. Resolution: Modified LLIMToastNotifyPanel::snapToMessageHeight to cleanly replicate what LLToastPanel::reshape was doing. --- indra/newview/lltoastnotifypanel.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview/lltoastnotifypanel.cpp') diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 3fd056ea31..c5a8d85392 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -426,7 +426,27 @@ LLIMToastNotifyPanel::~LLIMToastNotifyPanel() void LLIMToastNotifyPanel::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) { LLToastPanel::reshape(width, height, called_from_parent); - snapToMessageHeight(mTextBox, MAX_LENGTH); + snapToMessageHeight(); +} + +void LLIMToastNotifyPanel::snapToMessageHeight() +{ + if(!mTextBox) + { + return; + } + + //Add message height if it is visible + if (mTextBox->getVisible()) + { + S32 new_panel_height = computeSnappedToMessageHeight(mTextBox, MAX_LENGTH); + + //reshape the panel with new height + if (new_panel_height != getRect().getHeight()) + { + LLToastNotifyPanel::reshape( getRect().getWidth(), new_panel_height); + } + } } void LLIMToastNotifyPanel::compactButtons() -- cgit v1.2.3