diff options
author | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-12-12 18:53:06 +0200 |
---|---|---|
committer | AlexanderP ProductEngine <apaschenko@productengine.com> | 2012-12-12 18:53:06 +0200 |
commit | 4c20cc3e46d0392c63ecec304858493c8f59059b (patch) | |
tree | 5910f966777aae6d89f5da5107105bd2d46cd0c0 /indra | |
parent | 322fb006306524481ee09e88a079457b86fcd95a (diff) |
CHUI-584 : Addit. fix : Viewer crash when clicking on view/sort options drop down in conversation floater:
Cancelled unconditional receiving a instance of the floater (LLFloaterReg::getInstance()) from LLFloaterIMContainer::selectConversationPair(), because in some situations this method is called from LLFloaterIMNearbyChat::postBuild() - In other words, while the unfinished process of creation of this floater
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloaterimcontainer.cpp | 57 |
1 files changed, 31 insertions, 26 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 82bcd8efa4..3a5f2ae854 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -928,9 +928,9 @@ void LLFloaterIMContainer::getParticipantUUIDs(uuid_vec_t& selected_uuids) //When a one-on-one conversation exists, retrieve the participant id from the conversation floater else if(conversation_item->getType() == LLConversationItem::CONV_SESSION_1_ON_1) { - LLFloaterIMSession *conversationFloater = LLFloaterIMSession::findInstance(conversationItem->getUUID()); - LLUUID participantID = conversationFloater->getOtherParticipantUUID(); - selected_uuids.push_back(participantID); + LLFloaterIMSession * conversation_floaterp = LLFloaterIMSession::findInstance(conversation_item->getUUID()); + LLUUID participant_id = conversation_floaterp->getOtherParticipantUUID(); + selected_uuids.push_back(participant_id); } } @@ -1239,13 +1239,13 @@ void LLFloaterIMContainer::showConversation(const LLUUID& session_id) void LLFloaterIMContainer::selectConversation(const LLUUID& session_id) { selectConversationPair(session_id, true); - } +} // Synchronous select the conversation item and the conversation floater BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool select_widget) { BOOL handled = TRUE; - LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::getConversation(session_id); + LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(session_id); /* widget processing */ if (select_widget) @@ -1259,26 +1259,29 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool /* floater processing */ - if (session_id != getSelectedSession()) - { - // Store the active session - setSelectedSession(session_id); + if (NULL != session_floater) + { + if (session_id != getSelectedSession()) + { + // Store the active session + setSelectedSession(session_id); - if (session_floater->getHost()) - { - // Always expand the message pane if the panel is hosted by the container - collapseMessagesPane(false); - // Switch to the conversation floater that is being selected - selectFloater(session_floater); + if (session_floater->getHost()) + { + // Always expand the message pane if the panel is hosted by the container + collapseMessagesPane(false); + // Switch to the conversation floater that is being selected + selectFloater(session_floater); + } } - } - // Set the focus on the selected floater - if (!session_floater->hasFocus()) - { - session_floater->setFocus(TRUE); + // Set the focus on the selected floater + if (!session_floater->hasFocus()) + { + session_floater->setFocus(TRUE); + } } return handled; @@ -1388,12 +1391,14 @@ LLConversationItem* LLFloaterIMContainer::addConversationListItem(const LLUUID& // set the widget to minimized mode if conversations pane is collapsed widget->toggleCollapsedMode(mConversationsPane->isCollapsed()); - if (isWidgetSelected) - { - selectConversation(uuid); - // scroll to newly added item - mConversationsRoot->scrollToShowSelection(); - } + if (isWidgetSelected || 0 == mConversationsRoot->getSelectedCount()) + { + selectConversationPair(uuid, true); + widget->requestArrange(); + + // scroll to newly added item + mConversationsRoot->scrollToShowSelection(); + } return item; } |