diff options
-rw-r--r-- | indra/newview/llfolderview.cpp | 9 | ||||
-rw-r--r-- | indra/newview/llinventoryfilter.cpp | 18 |
2 files changed, 17 insertions, 10 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index d9c6f4d9ce..ec954ac881 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -429,8 +429,13 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen } else { - folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? - (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + bool visible = (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? + (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); + if (getFilter()) + { + visible &= getFilter()->check(folderp); + } + folderp->setVisible(visible); } if (folderp->getVisible()) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index b5062e65b5..e859535d18 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -91,20 +91,22 @@ LLInventoryFilter::~LLInventoryFilter() BOOL LLInventoryFilter::check(const LLFolderViewItem* item) { - // If it's a folder and we're showing all folders, return TRUE automatically. + // Clipboard cut items are *always* filtered so we need this value upfront + const LLFolderViewEventListener* listener = item->getListener(); + const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE); + + // If it's a folder and we're showing all folders, return automatically. const BOOL is_folder = (dynamic_cast<const LLFolderViewFolder*>(item) != NULL); if (is_folder && (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)) { - return TRUE; + return passed_clipboard; } mSubStringMatchOffset = mFilterSubString.size() ? item->getSearchableLabel().find(mFilterSubString) : std::string::npos; - const LLFolderViewEventListener* listener = item->getListener(); const BOOL passed_filtertype = checkAgainstFilterType(item); const BOOL passed_permissions = checkAgainstPermissions(item); const BOOL passed_filterlink = checkAgainstFilterLinks(item); - const BOOL passed_clipboard = (listener ? checkAgainstClipboard(listener->getUUID()) : TRUE); const BOOL passed = (passed_filtertype && passed_permissions && passed_filterlink && @@ -153,10 +155,13 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const { + // Always check against the clipboard + const BOOL passed_clipboard = checkAgainstClipboard(folder_id); + // we're showing all folders, overriding filter if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) { - return true; + return passed_clipboard; } if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) @@ -171,9 +176,6 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const return false; } - // Always check against the clipboard - const BOOL passed_clipboard = checkAgainstClipboard(folder_id); - return passed_clipboard; } |