summaryrefslogtreecommitdiff
path: root/indra/newview/llpreview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rwxr-xr-xindra/newview/llpreview.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index 398f4e6e42..bf2652cb49 100755
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -39,6 +39,7 @@
#include "llradiogroup.h"
#include "llassetstorage.h"
#include "llviewerassettype.h"
+#include "llviewermessage.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "lldbstrings.h"
@@ -53,7 +54,7 @@
LLPreview::LLPreview(const LLSD& key)
: LLFloater(key),
- mItemUUID(key.asUUID()),
+ mItemUUID(key.has("itemid") ? key.get("itemid").asUUID() : key.asUUID()),
mObjectUUID(), // set later by setObjectID()
mCopyToInvBtn( NULL ),
mForceClose(FALSE),
@@ -369,6 +370,20 @@ void LLPreview::onBtnCopyToInv(void* userdata)
self->mNotecardInventoryID,
item);
}
+ else if (self->mObjectUUID.notNull())
+ {
+ // item is in in-world inventory
+ LLViewerObject* object = gObjectList.findObject(self->mObjectUUID);
+ LLPermissions perm(item->getPermissions());
+ if(object
+ &&(perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID())
+ && perm.allowTransferTo(gAgent.getID())))
+ {
+ // copy to default folder
+ set_dad_inventory_item(item, LLUUID::null);
+ object->moveInventory(LLUUID::null, item->getUUID());
+ }
+ }
else
{
LLPointer<LLInventoryCallback> cb = NULL;
@@ -453,7 +468,6 @@ LLMultiPreview::LLMultiPreview()
setTitle(LLTrans::getString("MultiPreviewTitle"));
buildTabContainer();
setCanResize(TRUE);
- mAutoResize = FALSE;
}
void LLMultiPreview::onOpen(const LLSD& key)