summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorygallerymenu.cpp
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-31 15:23:11 +0300
committerMaxim Nikolenko <maximnproductengine@lindenlab.com>2023-03-31 15:23:11 +0300
commit126bfa4877303b47abbc99f09c09a931c20cbd3b (patch)
tree4b2d7b46c72e458e793f0933b5abb4c0e98475eb /indra/newview/llinventorygallerymenu.cpp
parent81d69cf84decb84bb7d65057063a19cb6c9fa6f5 (diff)
SL-19379 WIP fix for displaying folder link items, added correct action for 'paste as link'
Diffstat (limited to 'indra/newview/llinventorygallerymenu.cpp')
-rw-r--r--indra/newview/llinventorygallerymenu.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 21f7b06534..e91ec78730 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -250,9 +250,35 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata, const LLU
}
}
}
- else if ("paste_as_link" == action)
+ else if ("paste_link" == action)
{
- link_inventory_object(selected_id, obj, LLPointer<LLInventoryCallback>(NULL));
+ const LLUUID &current_outfit_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
+ const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS);
+ const LLUUID &my_outifts_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS);
+
+ const BOOL move_is_into_current_outfit = (selected_id == current_outfit_id);
+ const BOOL move_is_into_my_outfits = (selected_id == my_outifts_id) || gInventory.isObjectDescendentOf(selected_id, my_outifts_id);
+ const BOOL move_is_into_marketplacelistings = gInventory.isObjectDescendentOf(selected_id, marketplacelistings_id);
+
+ if (move_is_into_marketplacelistings || move_is_into_current_outfit || move_is_into_my_outfits)
+ {
+ return;
+ }
+
+ std::vector<LLUUID> objects;
+ LLClipboard::instance().pasteFromClipboard(objects);
+ for (std::vector<LLUUID>::const_iterator iter = objects.begin();
+ iter != objects.end();
+ ++iter)
+ {
+ const LLUUID &object_id = (*iter);
+ if (LLConstPointer<LLInventoryObject> link_obj = gInventory.getObject(object_id))
+ {
+ link_inventory_object(selected_id, link_obj, LLPointer<LLInventoryCallback>(NULL));
+ }
+ }
+
+ LLClipboard::instance().setCutMode(false);
}
else if ("rename" == action)
{