summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2016-01-11 20:26:16 +0200
committerandreykproductengine <akleshchev@productengine.com>2016-01-11 20:26:16 +0200
commitf412042e902350aa2a25ff1be79d75fa8d84e0f1 (patch)
treee09987ec05c58be401cff41558b8acdbdae30d7e
parent86ee5d92fcacf2fd55706a987c224b83c28f326b (diff)
MAINT-6025 FIXED "ctrl + z" not working on non-mod objects
-rwxr-xr-xindra/newview/llselectmgr.cpp19
-rwxr-xr-xindra/newview/llselectmgr.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 4f63df1ea2..323689b788 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -6746,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;
}
//-----------------------------------------------------------------------------
@@ -7672,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,
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 90f7fdfe13..bc50e443f8 100755
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -305,6 +305,7 @@ public:
LLViewerObject* getFirstCopyableObject(BOOL get_parent = FALSE);
LLViewerObject* getFirstDeleteableObject();
LLViewerObject* getFirstMoveableObject(BOOL get_parent = FALSE);
+ LLViewerObject* getFirstUndoEnabledObject(BOOL get_parent = FALSE);
/// Return the object that lead to this selection, possible a child
LLViewerObject* getPrimaryObject() { return mPrimaryObject; }