diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-04-30 19:50:05 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-04-30 19:50:05 -0700 |
commit | 806d09b1143894ad66cea2c228f467e8c39a8adf (patch) | |
tree | 512bfa5d5a8fe92ac4616fd9169e1c458b0e8b87 /indra/llui/lltabcontainer.cpp | |
parent | b06ec66a5d11628905da256e084d0036f39ba529 (diff) |
Merge 3.5.1 into Materials
Diffstat (limited to 'indra/llui/lltabcontainer.cpp')
-rw-r--r-- | indra/llui/lltabcontainer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 6f895ed939..fd98155704 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -1215,9 +1215,11 @@ void LLTabContainer::removeTabPanel(LLPanel* child) removeChild( tuple->mButton ); } delete tuple->mButton; + tuple->mButton = NULL; removeChild( tuple->mTabPanel ); // delete tuple->mTabPanel; + tuple->mTabPanel = NULL; mTabList.erase( iter ); delete tuple; @@ -1279,9 +1281,11 @@ void LLTabContainer::deleteAllTabs() removeChild( tuple->mButton ); delete tuple->mButton; + tuple->mButton = NULL; removeChild( tuple->mTabPanel ); // delete tuple->mTabPanel; + tuple->mTabPanel = NULL; } // Actually delete the tuples themselves @@ -1484,9 +1488,8 @@ BOOL LLTabContainer::setTab(S32 which) { LLTabTuple* tuple = *iter; BOOL is_selected = ( tuple == selected_tuple ); - // Although the selected tab must be complete, we may have hollow LLTabTuple tucked in the list - if (tuple->mButton) + if (tuple && tuple->mButton) { tuple->mButton->setUseEllipses(mUseTabEllipses); tuple->mButton->setHAlign(mFontHalign); @@ -1494,7 +1497,7 @@ BOOL LLTabContainer::setTab(S32 which) // 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) + if (tuple && tuple->mTabPanel) { tuple->mTabPanel->setVisible( is_selected ); //tuple->mTabPanel->setFocus(is_selected); // not clear that we want to do this here. @@ -1525,7 +1528,7 @@ BOOL LLTabContainer::setTab(S32 which) else { S32 available_width_with_arrows = getRect().getWidth() - mRightTabBtnOffset - 2 * (LLPANEL_BORDER_WIDTH + tabcntr_arrow_btn_size + tabcntr_arrow_btn_size + 1); - S32 running_tab_width = tuple->mButton->getRect().getWidth(); + S32 running_tab_width = (tuple && tuple->mButton ? tuple->mButton->getRect().getWidth() : 0); S32 j = i - 1; S32 min_scroll_pos = i; if (running_tab_width < available_width_with_arrows) @@ -1533,7 +1536,7 @@ BOOL LLTabContainer::setTab(S32 which) while (j >= 0) { LLTabTuple* other_tuple = getTab(j); - running_tab_width += other_tuple->mButton->getRect().getWidth(); + running_tab_width += (other_tuple && other_tuple->mButton ? other_tuple->mButton->getRect().getWidth() : 0); if (running_tab_width > available_width_with_arrows) { break; |