diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llfloater.h | 2 | ||||
| -rw-r--r-- | indra/llui/lltabcontainer.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5eb55e0420..32ee0227d0 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -185,7 +185,7 @@ public: // Defaults to destroy(). virtual void onClose(bool app_quitting) { destroy(); } - virtual BOOL canClose() const { return TRUE; } + virtual BOOL canClose() { return TRUE; } virtual void setVisible(BOOL visible); void setFrontmost(BOOL take_focus = TRUE); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 0e64c6df5c..8d1bab6bd7 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -344,7 +344,8 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) handled = LLPanel::handleMouseDown( x, y, mask ); } - if (getTabCount() > 0) + S32 tab_count = getTabCount(); + if (tab_count > 0) { LLTabTuple* firsttuple = getTab(0); LLRect tab_rect; @@ -364,7 +365,9 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) } if( tab_rect.pointInRect( x, y ) ) { - LLButton* tab_button = getTab(getCurrentPanelIndex())->mButton; + S32 index = getCurrentPanelIndex(); + index = llclamp(index, 0, tab_count-1); + LLButton* tab_button = getTab(index)->mButton; gFocusMgr.setMouseCapture(this); gFocusMgr.setKeyboardFocus(tab_button); } |
