diff options
Diffstat (limited to 'indra/newview/llselectmgr.cpp')
-rw-r--r--[-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..100644 --- 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, |