diff options
author | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-12 19:26:24 -0800 |
---|---|---|
committer | Gilbert Gonzales <gilbert@lindenlab.com> | 2013-02-12 19:26:24 -0800 |
commit | a33104ec5522352e23cdb788c003f830cd03cc1a (patch) | |
tree | 199f3642197b5251297d4fcdfdd6e0f84a33d7a1 /indra/newview/lltoastnotifypanel.cpp | |
parent | b1d03f940d4682db3e9866888d6f00f9300a55ed (diff) |
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.
Diffstat (limited to 'indra/newview/lltoastnotifypanel.cpp')
-rw-r--r-- | indra/newview/lltoastnotifypanel.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
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() |