summaryrefslogtreecommitdiff
path: root/indra/newview/llfolderviewitem.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-06-08 17:26:13 -0700
committerMerov Linden <merov@lindenlab.com>2012-06-08 17:26:13 -0700
commit1aba6c119ef05a4cfd91325c8455dc8c60098746 (patch)
treeddd4a3611a0b22efcee6b38b696994c192d6d6c9 /indra/newview/llfolderviewitem.cpp
parent3f7ecef1968b9087ba7c885a2dd6213120dfa547 (diff)
CHUI-137 : Implement conversation list, temporary solution: add but doesn't take out items from the list
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-rw-r--r--indra/newview/llfolderviewitem.cpp32
1 files changed, 21 insertions, 11 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 73715c78df..0800e0baa2 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -377,7 +377,10 @@ void LLFolderViewItem::setSelectionFromRoot(LLFolderViewItem* selection,
BOOL openitem,
BOOL take_keyboard_focus)
{
- getRoot()->setSelection(selection, openitem, take_keyboard_focus);
+ if (getRoot())
+ {
+ getRoot()->setSelection(selection, openitem, take_keyboard_focus);
+ }
}
// helper function to change the selection from the root.
@@ -754,7 +757,10 @@ BOOL LLFolderViewItem::handleHover( S32 x, S32 y, MASK mask )
}
else
{
- getRoot()->setShowSelectionContext(FALSE);
+ if (getRoot())
+ {
+ getRoot()->setShowSelectionContext(FALSE);
+ }
gViewerWindow->setCursor(UI_CURSOR_ARROW);
// let parent handle this then...
return FALSE;
@@ -797,7 +803,10 @@ BOOL LLFolderViewItem::handleMouseUp( S32 x, S32 y, MASK mask )
if( hasMouseCapture() )
{
- getRoot()->setShowSelectionContext(FALSE);
+ if (getRoot())
+ {
+ getRoot()->setShowSelectionContext(FALSE);
+ }
gFocusMgr.setMouseCapture( NULL );
}
return TRUE;
@@ -864,8 +873,9 @@ void LLFolderViewItem::draw()
const S32 FOCUS_LEFT = 1;
const LLFontGL* font = getLabelFontForStyle(mLabelStyle);
- const BOOL in_inventory = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getRootFolderID());
- const BOOL in_library = getListener() && getListener()->getUUID().notNull() && gInventory.isObjectDescendentOf(getListener()->getUUID(), gInventory.getLibraryRootFolderID());
+ const LLUUID uuid = (getListener() ? getListener()->getUUID() : LLUUID::null);
+ const BOOL in_inventory = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getRootFolderID()) : FALSE);
+ const BOOL in_library = (uuid.notNull() ? gInventory.isObjectDescendentOf(uuid, gInventory.getLibraryRootFolderID()) : FALSE);
//--------------------------------------------------------------------------------//
// Draw open folder arrow
@@ -885,8 +895,8 @@ void LLFolderViewItem::draw()
//--------------------------------------------------------------------------------//
// Draw highlight for selected items
//
- const BOOL show_context = getRoot()->getShowSelectionContext();
- const BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus()); // If we have keyboard focus, draw selection filled
+ const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
+ const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled
const S32 focus_top = getRect().getHeight();
const S32 focus_bottom = getRect().getHeight() - mItemHeight;
const bool folder_open = (getRect().getHeight() > mItemHeight + 4);
@@ -897,8 +907,8 @@ void LLFolderViewItem::draw()
if (!mIsCurSelection)
{
// do time-based fade of extra objects
- F32 fade_time = getRoot()->getSelectionFadeElapsedTime();
- if (getRoot()->getShowSingleSelection())
+ F32 fade_time = (getRoot() ? getRoot()->getSelectionFadeElapsedTime() : 0.0f);
+ if (getRoot() && getRoot()->getShowSingleSelection())
{
// fading out
bg_color.mV[VALPHA] = clamp_rescale(fade_time, 0.f, 0.4f, bg_color.mV[VALPHA], 0.f);
@@ -1009,7 +1019,7 @@ void LLFolderViewItem::draw()
//--------------------------------------------------------------------------------//
// Highlight filtered text
//
- if (getRoot()->getDebugFilters())
+ if (getRoot() && getRoot()->getDebugFilters())
{
if (!getFiltered() && !possibly_has_children)
{
@@ -1070,7 +1080,7 @@ void LLFolderViewItem::draw()
if (mStringMatchOffset != std::string::npos)
{
// don't draw backgrounds for zero-length strings
- S32 filter_string_length = getRoot()->getFilterSubString().size();
+ S32 filter_string_length = (getRoot() ? getRoot()->getFilterSubString().size() : 0);
if (filter_string_length > 0)
{
std::string combined_string = mLabel + mLabelSuffix;