ACME-307 Fix crash when clicking profile button: The crash was caused by existing code which was taking the last focused element and assuming it was a pointer to a LLUICtrl. Now assume the pointer is of type LLView since there is not need to have it as a LLUICtrl pointer.

meow-7.2.2
Gilbert Gonzales 2013-05-02 16:41:16 -07:00
parent 90cf755eaf
commit 933cff41a6
3 changed files with 4 additions and 4 deletions

View File

@ -1346,7 +1346,7 @@ void LLFloater::setFocus( BOOL b )
{
return;
}
LLUICtrl* last_focus = gFocusMgr.getLastFocusForGroup(this);
LLView* last_focus = gFocusMgr.getLastFocusForGroup(this);
// a descendent already has focus
BOOL child_had_focus = hasFocus();

View File

@ -469,7 +469,7 @@ void LLFocusMgr::setAppHasFocus(BOOL focus)
mAppHasFocus = focus;
}
LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
LLView* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
{
if (subtree_root)
{
@ -477,7 +477,7 @@ LLUICtrl* LLFocusMgr::getLastFocusForGroup(LLView* subtree_root) const
if (found_it != mImpl->mFocusHistory.end())
{
// found last focus for this subtree
return static_cast<LLUICtrl*>(found_it->second.get());
return found_it->second.get();
}
}
return NULL;

View File

@ -97,7 +97,7 @@ public:
void triggerFocusFlash();
BOOL getAppHasFocus() const { return mAppHasFocus; }
void setAppHasFocus(BOOL focus);
LLUICtrl* getLastFocusForGroup(LLView* subtree_root) const;
LLView* getLastFocusForGroup(LLView* subtree_root) const;
void clearLastFocusForGroup(LLView* subtree_root);
// If setKeyboardFocus(NULL) is called, and there is a non-NULL default