File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4136,6 +4136,17 @@ void LLFolderBridge::perform_pasteFromClipboard()
41364136 }
41374137 else
41384138 {
4139+ // Check that no folder is being pasted into itself or into one of its descendants
4140+ for (const LLUUID & item_id : objects)
4141+ {
4142+ LLInventoryCategory* cat = model->getCategory (item_id);
4143+ if (cat && (item_id == mUUID || model->isObjectDescendentOf (mUUID , item_id)))
4144+ {
4145+ LLNotificationsUtil::add (" CannotPasteFolderIntoSelf" );
4146+ return ;
4147+ }
4148+ }
4149+
41394150 // Check that all items can be moved into that folder : for the moment, only stock folder mismatch is checked
41404151 for (std::vector<LLUUID >::const_iterator iter = objects.begin (); iter != objects.end (); ++iter)
41414152 {
Original file line number Diff line number Diff line change @@ -424,6 +424,17 @@ Initialization with the Marketplace failed because of a system or network error.
424424 yestext =" OK" />
425425 </notification >
426426
427+ <notification
428+ icon =" alertmodal.tga"
429+ name =" CannotPasteFolderIntoSelf"
430+ type =" alertmodal" >
431+ You cannot paste a folder into itself or into one of its subfolders.
432+ <tag >fail</tag >
433+ <usetemplate
434+ name =" okbutton"
435+ yestext =" OK" />
436+ </notification >
437+
427438 <notification
428439 icon =" notifytip.tga"
429440 name =" InvalidKeystroke"
You can’t perform that action at this time.
0 commit comments