diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-11-29 10:45:43 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-11-29 10:45:43 +0200 |
commit | d1c0a5b840e9ec2d3a468216339ae5367aed4bf5 (patch) | |
tree | 30a47a8bf5ba4561c0f6d3839afd1a9f35dac873 /indra/newview/llpreview.cpp | |
parent | 6f99a844efe4e7809ed0a995b0118851e6f0d8d5 (diff) | |
parent | 53e958a2638705572ed7dbf61369d92b332c4b60 (diff) |
Merge branch 'DRTVWR-559' into marchcat/587-v-pbr-merge
# Conflicts:
# indra/llcommon/CMakeLists.txt
# indra/newview/llspatialpartition.cpp
# indra/newview/llviewergenericmessage.cpp
# indra/newview/llvoavatar.cpp
Diffstat (limited to 'indra/newview/llpreview.cpp')
-rw-r--r-- | indra/newview/llpreview.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index fc2de4844e..0117db86e8 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -115,8 +115,11 @@ const LLInventoryItem *LLPreview::getItem() const } else if (mObjectUUID.isNull()) { - // it's an inventory item, so get the item. - item = gInventory.getItem(mItemUUID); + if (mItemUUID.notNull()) + { + // it's an inventory item, so get the item. + item = gInventory.getItem(mItemUUID); + } } else { @@ -238,14 +241,22 @@ void LLPreview::refreshFromItem() // static BOOL LLPreview::canModify(const LLUUID taskUUID, const LLInventoryItem* item) { + const LLViewerObject* object = nullptr; if (taskUUID.notNull()) { - LLViewerObject* object = gObjectList.findObject(taskUUID); - if(object && !object->permModify()) - { - // No permission to edit in-world inventory - return FALSE; - } + object = gObjectList.findObject(taskUUID); + } + + return canModify(object, item); +} + +// static +BOOL LLPreview::canModify(const LLViewerObject* object, const LLInventoryItem* item) +{ + if (object && !object->permModify()) + { + // No permission to edit in-world inventory + return FALSE; } return item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); |