]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #2451 : shaper shuts down by itself
authormpv <mikhail.ponikarov@opencascade.com>
Tue, 27 Feb 2018 12:41:02 +0000 (15:41 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Tue, 27 Feb 2018 12:41:02 +0000 (15:41 +0300)
src/XGUI/XGUI_Workshop.cpp

index 4ff214d084a3bc23046df4c383c8f206b65f5c31..fbca21045e6c0a35157af4e0edcaf80b1a8ee20c 100755 (executable)
@@ -2026,6 +2026,16 @@ bool XGUI_Workshop::canMoveFeature()
   QObjectPtrList::const_iterator anIt = aObjects.begin(), aLast = aObjects.end();
   for (; anIt != aLast && aCanMove; anIt++) {
     ObjectPtr aObject = *anIt;
+    if (!aObject.get() || !aObject->data().get() || !aObject->data()->isValid()) {
+      aCanMove = false;
+      break;
+    }
+    FeaturePtr aFeat = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+    if (aFeat.get() && aFeat->getKind() != "Group") { // only groups can be moved to the end for now (#2451)
+      aCanMove = false;
+      break;
+    }
+
     // 1. Get features placed between selected and current in the document
     std::list<FeaturePtr> aFeaturesBetween = toCurrentFeatures(aObject);
     // if aFeaturesBetween is empty it means wrong order or aObject is the current feature