diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 188ef37ea..f88c26115 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -708,26 +708,20 @@ void LLPanelPermissions::refresh() } // Is this user allowed to toggle export on this object? - { - bool can_export = self_owned && mCreatorID == mOwnerID/* && simSupportsExport()*/; //TODO: Implement Simulator Feature for Export. - if (can_export) + if (self_owned && mCreatorID == mOwnerID/* && simSupportsExport()*/ //TODO: Implement Simulator Feature for Export. + && (base_mask_on & PERM_EXPORT && owner_mask_on & PERM_EXPORT && (next_owner_mask_on & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)) //Base and Owner must have EXPORT, Next Owner must be UNRESTRICTED { - if (can_export = (base_mask_on & PERM_EXPORT && owner_mask_on & PERM_EXPORT && (next_owner_mask_on & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)) //Base and Owner must have EXPORT, Next Owner must be UNRESTRICTED - { + bool can_export = true; LLInventoryObject::object_list_t objects; objectp->getInventoryContents(objects); - for (LLInventoryObject::object_list_t::iterator i = objects.begin(); i != objects.end(); ++i) //The object's inventory must have EXPORT. + for (LLInventoryObject::object_list_t::iterator i = objects.begin(); can_export && i != objects.end() ; ++i) //The object's inventory must have EXPORT. { LLViewerInventoryItem* item = static_cast(i->get()); //getInventoryContents() filters out categories, static_cast. const LLPermissions& perm = item->getPermissions(); if (!(perm.getMaskBase() & PERM_EXPORT && perm.getMaskEveryone() & PERM_EXPORT)) - { can_export = false; - break; - } } - if (can_export) - for (U8 i = 0; i < objectp->getNumTEs(); ++i) // Can the textures be exported? + for (U8 i = 0; can_export && i < objectp->getNumTEs(); ++i) // Can the textures be exported? if (LLTextureEntry* texture = objectp->getTE(i)) { const LLUUID id = texture->getID(); @@ -736,18 +730,14 @@ void LLPanelPermissions::refresh() { const LLPermissions& perm = item->getPermissions(); can_export = perm.getMaskBase() & PERM_EXPORT && (perm.getMaskOwner() & PERM_EXPORT || perm.getMaskEveryone() & PERM_EXPORT); - if (!can_export) break; } else // Texture not in inventory - { can_export = false; - break; - } } - } + childSetEnabled("checkbox allow export", can_export); } - childSetEnabled("checkbox allow export", can_export); - } + else + childSetEnabled("checkbox allow export", false); if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER)) {