summaryrefslogtreecommitdiff
path: root/indra/llui/llmenubutton.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2012-04-14 22:28:49 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2012-04-14 22:28:49 +0300
commit3adf89351359210f6f8a0f33cef94733a815dea1 (patch)
tree851bb55736a160f9892831bdf397cdf7811df96b /indra/llui/llmenubutton.cpp
parent590890173216570ca834ba1ead66db1a25952247 (diff)
CHU-78 WIP Subtle cleanup.
Diffstat (limited to 'indra/llui/llmenubutton.cpp')
-rw-r--r--indra/llui/llmenubutton.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp
index 320f62d5c1..746ade4648 100644
--- a/indra/llui/llmenubutton.cpp
+++ b/indra/llui/llmenubutton.cpp
@@ -74,8 +74,6 @@ boost::signals2::connection LLMenuButton::setMouseDownCallback( const mouse_sign
void LLMenuButton::hideMenu()
{
- if(mMenuHandle.isDead()) return;
-
LLToggleableMenu* menu = getMenu();
if (menu)
{
@@ -120,7 +118,7 @@ void LLMenuButton::setMenu(LLToggleableMenu* menu, EMenuPosition position /*MP_T
BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
{
- if (mMenuHandle.isDead()) return FALSE;
+ if (!getMenu()) return FALSE;
if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
{
@@ -158,8 +156,6 @@ void LLMenuButton::toggleMenu()
return;
}
- if(mMenuHandle.isDead()) return;
-
LLToggleableMenu* menu = getMenu();
if (!menu) return;
@@ -189,7 +185,8 @@ void LLMenuButton::toggleMenu()
void LLMenuButton::updateMenuOrigin()
{
- if (mMenuHandle.isDead()) return;
+ LLToggleableMenu* menu = getMenu();
+ if (!menu) return;
LLRect rect = getRect();
@@ -198,12 +195,12 @@ void LLMenuButton::updateMenuOrigin()
case MP_TOP_LEFT:
{
mX = rect.mLeft;
- mY = rect.mTop + mMenuHandle.get()->getRect().getHeight();
+ mY = rect.mTop + menu->getRect().getHeight();
break;
}
case MP_TOP_RIGHT:
{
- const LLRect& menu_rect = mMenuHandle.get()->getRect();
+ const LLRect& menu_rect = menu->getRect();
mX = rect.mRight - menu_rect.getWidth();
mY = rect.mTop + menu_rect.getHeight();
break;