CHUI-807 : More defensive code. Don't assume anything while iterating through panels.

meow-7.2.2
Merov Linden 2013-03-15 17:54:16 -07:00
parent 5b4746701b
commit 242c39f24b
2 changed files with 18 additions and 14 deletions

View File

@ -1483,16 +1483,22 @@ BOOL LLTabContainer::setTab(S32 which)
for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
{
LLTabTuple* tuple = *iter;
if (!tuple)
continue;
BOOL is_selected = ( tuple == selected_tuple );
tuple->mButton->setUseEllipses(mUseTabEllipses);
tuple->mButton->setHAlign(mFontHalign);
tuple->mTabPanel->setVisible( is_selected );
// tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.
tuple->mButton->setToggleState( is_selected );
// RN: this limits tab-stops to active button only, which would require arrow keys to switch tabs
tuple->mButton->setTabStop( is_selected );
// Although the selected tab must be complete, we may have hollow LLTabTuple tucked in the list
if (tuple->mButton)
{
tuple->mButton->setUseEllipses(mUseTabEllipses);
tuple->mButton->setHAlign(mFontHalign);
tuple->mButton->setToggleState( is_selected );
// RN: this limits tab-stops to active button only, which would require arrow keys to switch tabs
tuple->mButton->setTabStop( is_selected );
}
if (tuple->mTabPanel)
{
tuple->mTabPanel->setVisible( is_selected );
//tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here.
}
if (is_selected)
{
@ -1563,8 +1569,7 @@ BOOL LLTabContainer::selectTabByName(const std::string& name)
LLPanel* panel = getPanelByName(name);
if (!panel)
{
llwarns << "LLTabContainer::selectTabByName("
<< name << ") failed" << llendl;
llwarns << "LLTabContainer::selectTabByName(" << name << ") failed" << llendl;
return FALSE;
}

View File

@ -641,8 +641,7 @@ void LLIMModel::LLIMSession::loadHistory()
LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const
{
return get_if_there(mId2SessionMap, session_id,
(LLIMModel::LLIMSession*) NULL);
return get_if_there(mId2SessionMap, session_id, (LLIMModel::LLIMSession*) NULL);
}
//*TODO consider switching to using std::set instead of std::list for holding LLUUIDs across the whole code
@ -2809,7 +2808,7 @@ LLUUID LLIMMgr::addSession(
}
}
bool new_session = !LLIMModel::getInstance()->findIMSession(session_id);
bool new_session = (LLIMModel::getInstance()->findIMSession(session_id) == NULL);
//works only for outgoing ad-hoc sessions
if (new_session && IM_SESSION_CONFERENCE_START == dialog && ids.size())