summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorNyx Linden <nyx@lindenlab.com>2013-04-05 15:24:22 -0400
committerNyx Linden <nyx@lindenlab.com>2013-04-05 15:24:22 -0400
commit3e53ade13e7c9e70ba67a1e845696712081f7651 (patch)
treec77ef8c210581c3b3852aeba205e8a5666c803a9 /indra/llui
parent323a2f2235a52383bcfbae79bdce9e61ca808d2a (diff)
parent37303b9a2b58e3f66d246a0f4d2e6072eabcba86 (diff)
merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltabcontainer.cpp13
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;