summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-10-09 23:20:41 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-10-10 11:21:05 +0300
commitd5218c05219a6bddb63d752a9df3b5d6fe1e3cf7 (patch)
treee1a7b69c31f5493f1fd2fac0854645fd456692ba /indra/newview/llinventorybridge.cpp
parenta9dfb9d918fe12851ef93110baa149e1c49d2efa (diff)
viewer#2818 Creating a link to an empty notecard fails #3
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 114fdf1d9f..2deb7caad5 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -691,13 +691,6 @@ bool LLInvFVBridge::isClipboardPasteableAsLink() const
{
return false;
}
- if (item->getAssetUUID().isNull()
- && (item->getActualType() == LLAssetType::AT_NOTECARD
- || item->getActualType() == LLAssetType::AT_MATERIAL))
- {
- // otehrwise AIS will return 'Cannot link to items with a NULL asset_id.'
- return false;
- }
}
const LLViewerInventoryCategory *cat = model->getCategory(item_id);
if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType()))
@@ -4196,6 +4189,32 @@ void LLFolderBridge::pasteLinkFromClipboard()
std::vector<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
+ if (objects.size() == 0)
+ {
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+
+ LLUUID& first_id = objects[0];
+ LLInventoryItem* item = model->getItem(first_id);
+ if (item && item->getAssetUUID().isNull())
+ {
+ if (item->getActualType() == LLAssetType::AT_NOTECARD)
+ {
+ // otehrwise AIS will return 'Cannot link to items with a NULL asset_id.'
+ LLNotificationsUtil::add("CantLinkNotecard");
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+ else if (item->getActualType() == LLAssetType::AT_MATERIAL)
+ {
+ LLNotificationsUtil::add("CantLinkMaterial");
+ LLClipboard::instance().setCutMode(false);
+ return;
+ }
+ }
+
+
LLPointer<LLInventoryCallback> cb = NULL;
LLInventoryPanel* panel = mInventoryPanel.get();
if (panel->getRootFolder()->isSingleFolderMode())