summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfilter.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-02-09 23:37:24 -0800
committerMerov Linden <merov@lindenlab.com>2012-02-09 23:37:24 -0800
commit2a4aa438f5798c34f1eef3ef75dc3289492138e1 (patch)
tree06ef82d5d556f0ae4c275588886fa99371154414 /indra/newview/llinventoryfilter.cpp
parent10dadc6b0dd646faa251c0935e75d07c97b3052d (diff)
EXP-1863 : Implemented cut, copy, paste for folders. Issues with folder filtering though.
Diffstat (limited to 'indra/newview/llinventoryfilter.cpp')
-rw-r--r--indra/newview/llinventoryfilter.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 9d12478019..808b7619eb 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -240,12 +240,26 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con
////////////////////////////////////////////////////////////////////////////////
// FILTERTYPE_CLIPBOARD
- // Pass if this item is not on the clipboard
+ // Pass if this item is not on the clipboard or is not a descendant of a folder
+ // which is on the clipboard
if (filterTypes & FILTERTYPE_CLIPBOARD)
{
- if (LLClipboard::getInstance()->isCutMode() && LLClipboard::getInstance()->isOnClipboard(object_id))
+ if (LLClipboard::getInstance()->isCutMode())
{
- return FALSE;
+ LLUUID current_id = object_id;
+ LLInventoryObject *current_object = gInventory.getObject(object_id);
+ while (current_id.notNull())
+ {
+ if (LLClipboard::getInstance()->isOnClipboard(current_id))
+ {
+ return FALSE;
+ }
+ current_id = current_object->getParentUUID();
+ if (current_id.notNull())
+ {
+ current_object = gInventory.getObject(current_id);
+ }
+ }
}
}
@@ -309,6 +323,31 @@ bool LLInventoryFilter::checkAgainstFilterType(const LLInventoryItem* item) cons
return false;
}
+ ////////////////////////////////////////////////////////////////////////////////
+ // FILTERTYPE_CLIPBOARD
+ // Pass if this item is not on the clipboard or is not a descendant of a folder
+ // which is on the clipboard
+ if (filterTypes & FILTERTYPE_CLIPBOARD)
+ {
+ if (LLClipboard::getInstance()->isCutMode())
+ {
+ LLUUID current_id = object_id;
+ LLInventoryObject *current_object = gInventory.getObject(object_id);
+ while (current_id.notNull())
+ {
+ if (LLClipboard::getInstance()->isOnClipboard(current_id))
+ {
+ return false;
+ }
+ current_id = current_object->getParentUUID();
+ if (current_id.notNull())
+ {
+ current_object = gInventory.getObject(current_id);
+ }
+ }
+ }
+ }
+
return true;
}