diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-21 11:00:22 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2016-03-21 11:00:22 -0400 |
commit | 2afde26d93cc8773f5e84d187844f909347fc1bf (patch) | |
tree | 5857549829b90f047ae094ebd9b6a9d2817d59aa /indra/newview/llselectmgr.cpp | |
parent | 132a2587dff85006636d8092ae1b34081f12fe69 (diff) | |
parent | 4aae7b51616c0963af4668442bdb5bfaba8c5044 (diff) |
merge
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rwxr-xr-x | indra/newview/llselectmgr.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 7620046ee3..323689b788 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -1628,7 +1628,11 @@ void LLSelectMgr::selectionSetImage(const LLUUID& imageid) f(LLViewerInventoryItem* item, const LLUUID& id) : mItem(item), mImageID(id) {} bool apply(LLViewerObject* objectp, S32 te) { - if (mItem) + if(objectp && !objectp->permModify()) + { + return false; + } + if (mItem) { if (te == -1) // all faces { @@ -6742,7 +6746,8 @@ LLBBox LLSelectMgr::getBBoxOfSelection() const //----------------------------------------------------------------------------- BOOL LLSelectMgr::canUndo() const { - return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstEditableObject() != NULL; // HACK: casting away constness - MG + // Can edit or can move + return const_cast<LLSelectMgr*>(this)->mSelectedObjects->getFirstUndoEnabledObject() != NULL; // HACK: casting away constness - MG; } //----------------------------------------------------------------------------- @@ -7668,6 +7673,22 @@ LLViewerObject* LLObjectSelection::getFirstMoveableObject(BOOL get_parent) } //----------------------------------------------------------------------------- +// getFirstUndoEnabledObject() +//----------------------------------------------------------------------------- +LLViewerObject* LLObjectSelection::getFirstUndoEnabledObject(BOOL get_parent) +{ + struct f : public LLSelectedNodeFunctor + { + bool apply(LLSelectNode* node) + { + LLViewerObject* obj = node->getObject(); + return obj && (obj->permModify() || (obj->permMove() && !obj->isPermanentEnforced())); + } + } func; + return getFirstSelectedObject(&func, get_parent); +} + +//----------------------------------------------------------------------------- // Position + Rotation update methods called from LLViewerJoystick //----------------------------------------------------------------------------- bool LLSelectMgr::selectionMove(const LLVector3& displ, |