diff options
author | Merov Linden <merov@lindenlab.com> | 2012-02-23 09:57:05 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-02-23 09:57:05 -0800 |
commit | a7499dc4abfa5fa7582dc7ebb535a07ed94d0c4f (patch) | |
tree | 10a1cfd87173fd248627ba7d658bcefaf6db1054 /indra/newview/llfolderviewitem.cpp | |
parent | c2922a402d2e45284e2cd829175b958e081b264d (diff) |
EXP-1895 : Fix the evaluation of visible children in folders
Diffstat (limited to 'indra/newview/llfolderviewitem.cpp')
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 884cddfe7f..0b4baf52f9 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1159,7 +1159,36 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) mNeedsSort = false; } + // evaluate mHasVisibleChildren mHasVisibleChildren = hasFilteredDescendants(filter_generation); + if (mHasVisibleChildren) + { + // We have to verify that there's at least one child that's not filtered out + bool found = false; + // Try the items first + for (items_t::iterator iit = mItems.begin(); iit != mItems.end(); ++iit) + { + LLFolderViewItem* itemp = (*iit); + found = (itemp->getFiltered(filter_generation)); + if (found) + break; + } + if (!found) + { + // If no item found, try the folders + for (folders_t::iterator fit = mFolders.begin(); fit != mFolders.end(); ++fit) + { + LLFolderViewFolder* folderp = (*fit); + found = ( folderp->getListener() + && (folderp->getFiltered(filter_generation) + || (folderp->getFilteredFolder(filter_generation) + && folderp->hasFilteredDescendants(filter_generation)))); + if (found) + break; + } + } + mHasVisibleChildren = found; + } // calculate height as a single item (without any children), and reshapes rectangle to match LLFolderViewItem::arrange( width, height, filter_generation ); |