summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-03-12 17:43:46 -0700
committerMerov Linden <merov@lindenlab.com>2012-03-12 17:43:46 -0700
commitd439e859ee78454fa1857605c87dd105ccf1b844 (patch)
treeb060c6cfb21de7d04de7c7ed795fcb080208c17a /indra/newview
parent7b866448dbeeeb04b074df493369927afcf9971a (diff)
parent0df0218329ce894afe3a27980a2862ac4a584be7 (diff)
Merge
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventorybridge.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 96785eb312..060250cc07 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -434,6 +434,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
BOOL LLInvFVBridge::isClipboardPasteable() const
{
+ // Return FALSE on degenerated cases: empty clipboard, no inventory, no agent
if (!LLClipboard::instance().hasContents() || !isAgentInventory())
{
return FALSE;
@@ -444,6 +445,13 @@ BOOL LLInvFVBridge::isClipboardPasteable() const
return FALSE;
}
+ // In cut mode, whatever is on the clipboard is always pastable
+ if (LLClipboard::instance().isCutMode())
+ {
+ return TRUE;
+ }
+
+ // In normal mode, we need to check each element of the clipboard to know if we can paste or not
LLDynamicArray<LLUUID> objects;
LLClipboard::instance().pasteFromClipboard(objects);
S32 count = objects.count();
@@ -658,7 +666,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
items.push_back(std::string("Paste"));
}
- if ((!LLClipboard::instance().isCutMode() && !isClipboardPasteable()) || ((flags & FIRST_SELECTED_ITEM) == 0))
+ if (!isClipboardPasteable() || ((flags & FIRST_SELECTED_ITEM) == 0))
{
disabled_items.push_back(std::string("Paste"));
}
@@ -2926,7 +2934,7 @@ bool LLFolderBridge::removeItemResponse(const LLSD& notification, const LLSD& re
void LLFolderBridge::pasteFromClipboard()
{
LLInventoryModel* model = getInventoryModel();
- if (model && (isClipboardPasteable() || LLClipboard::instance().isCutMode()))
+ if (model && isClipboardPasteable())
{
const LLUUID &current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);
const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false);