diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-04-15 22:14:38 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-04-15 22:14:38 +0300 |
commit | bbdbd6c2dd79adc4749e24c88c9f04755a4b12a1 (patch) | |
tree | 4f27b7f1f8edf304227e4d3d1c0755ef342cb61e /indra/newview | |
parent | 7f315b1552dd01e0ee2ff58e84f1fc87fa675cdf (diff) |
SL-17204 FIXED The texture with full permissions is settled on the prim after copying texture from the object with texture with no transfer permission
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanelface.cpp | 7 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.cpp | 13 | ||||
-rw-r--r-- | indra/newview/lltexturectrl.h | 2 |
3 files changed, 17 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 2ac5022695..f50f587f8f 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -2873,7 +2873,12 @@ void LLPanelFace::onCopyTexture() // as result it is Hightly unreliable, leaves little control to user, borderline hack // but there are little options to preserve permissions - multiple inventory // items might reference same asset and inventory search is expensive. - item_id = get_copy_free_item_by_asset_id(id); + bool no_transfer = false; + if (objectp->getInventoryItemByAsset(id)) + { + no_transfer = !objectp->getInventoryItemByAsset(id)->getIsFullPerm(); + } + item_id = get_copy_free_item_by_asset_id(id, no_transfer); // record value to avoid repeating inventory search when possible asset_item_map[id] = item_id; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index cc912758e2..51ee5b6157 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -95,7 +95,7 @@ bool get_is_predefined_texture(LLUUID asset_id) return false; } -LLUUID get_copy_free_item_by_asset_id(LLUUID asset_id) +LLUUID get_copy_free_item_by_asset_id(LLUUID asset_id, bool no_trans_perm) { LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; @@ -105,6 +105,8 @@ LLUUID get_copy_free_item_by_asset_id(LLUUID asset_id) items, LLInventoryModel::INCLUDE_TRASH, asset_id_matches); + + LLUUID res; if (items.size()) { for (S32 i = 0; i < items.size(); i++) @@ -117,12 +119,17 @@ LLUUID get_copy_free_item_by_asset_id(LLUUID asset_id) gAgent.getID(), gAgent.getGroupID())) { - return itemp->getUUID(); + bool allow_trans = item_permissions.allowOperationBy(PERM_TRANSFER, gAgent.getID(), gAgent.getGroupID()); + if (allow_trans != no_trans_perm) + { + return itemp->getUUID(); + } + res = itemp->getUUID(); } } } } - return LLUUID::null; + return res; } bool get_can_copy_texture(LLUUID asset_id) diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h index 4250cf86b8..3769f43737 100644 --- a/indra/newview/lltexturectrl.h +++ b/indra/newview/lltexturectrl.h @@ -60,7 +60,7 @@ bool get_is_predefined_texture(LLUUID asset_id); // for textures in inventory by asset ids // This search can be performance unfriendly and doesn't warranty // that the texture is original source of asset -LLUUID get_copy_free_item_by_asset_id(LLUUID image_id); +LLUUID get_copy_free_item_by_asset_id(LLUUID image_id, bool no_trans_perm = false); bool get_can_copy_texture(LLUUID image_id); ////////////////////////////////////////////////////////////////////////////////////////// |