summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-02-05 18:38:40 -0500
committerLoren Shih <seraph@lindenlab.com>2010-02-05 18:38:40 -0500
commit295843ee3616ae01eae359f81d3ac2f468e780dd (patch)
treec47ed1d01919e484ae106ecf49dc8bd5ea911f3b /indra
parent41ab7853536dcbbf2b64d06b754617ee6bc7e896 (diff)
EXT-4984 : Dragging an object out of the COF manually does not unwear that item
One-line change to forbid dragging items out of the COF. Also added some cosmetic cleanup (some whitespace cleanup, const, etc.)
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventorybridge.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index c024304f26..f246b6b529 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -787,7 +787,7 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model,
const LLUUID& new_parent_id,
BOOL restamp)
{
- if(item->getParentUUID() != new_parent_id)
+ if (item->getParentUUID() != new_parent_id)
{
LLInventoryModel::update_list_t update;
LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1);
@@ -3002,7 +3002,6 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
LLViewerObject* object = NULL;
if(LLToolDragAndDrop::SOURCE_AGENT == source)
{
-
BOOL is_movable = TRUE;
switch( inv_item->getActualType() )
{
@@ -3014,11 +3013,18 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
}
const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
- BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
+ const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id);
const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT);
- BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
- BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+ const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id);
+ const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT);
+ const BOOL move_is_outof_current_outfit = LLAppearanceManager::instance().getIsInCOF(inv_item->getUUID());
+ // Can't explicitly drag things out of the COF.
+ if (move_is_outof_current_outfit)
+ {
+ is_movable = FALSE;
+ }
+
if(is_movable && move_is_into_trash)
{
is_movable = inv_item->getIsLinkType() || !get_is_item_worn(inv_item->getUUID());