diff options
| author | merov <none@none> | 2012-03-12 17:21:32 -0700 | 
|---|---|---|
| committer | merov <none@none> | 2012-03-12 17:21:32 -0700 | 
| commit | 0df0218329ce894afe3a27980a2862ac4a584be7 (patch) | |
| tree | e0ff140d6af7354818482d6b0605638c92fadc18 | |
| parent | 8a792a86fad7c610651b964d164b8f099c790562 (diff) | |
EXP-1914 : Fix the evaluation of isClipboardPasteable() when the clipboard is in cut mode.
| -rw-r--r-- | indra/newview/llinventorybridge.cpp | 12 | 
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 ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false);  		const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); | 
