]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Partial fix #34401 Allows to move to the end GroupSubstraction GroupAddition GroupInt... cbr/fix_move_to_the_end_on_group_substraction
authorChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 7 Apr 2023 08:38:05 +0000 (10:38 +0200)
committerChristophe Bourcier <christophe.bourcier@cea.fr>
Fri, 7 Apr 2023 08:38:05 +0000 (10:38 +0200)
src/XGUI/XGUI_Workshop.cpp

index 482fcb8e840b026e178883cc7fca434e45f6a8ae..bf693674f9ff2134b9c0a8ef5e851b4f8018aeb9 100644 (file)
@@ -2435,12 +2435,24 @@ bool XGUI_Workshop::canMoveFeature()
       break;
     }
     FeaturePtr aFeat = std::dynamic_pointer_cast<ModelAPI_Feature>(anObject);
-    // only groups can be moved to the end for now (#2451)
-    if (aFeat.get() && aFeat->getKind() != "Group") {
-      aCanMove = false;
-      break;
+    // only groups can be moved to the end for now (#2451 old_id, #23105 tuleap id)
+    // and groups created by other groups (#34401)
+    if (aFeat.get()) {
+      std::string aKindOfFeature = aFeat->getKind();
+      if (aKindOfFeature != "Group" &&
+          aKindOfFeature != "GroupSubstraction" &&
+          aKindOfFeature != "GroupAddition" &&
+          aKindOfFeature != "GroupIntersection") {
+        aCanMove = false;
+        break;
+      }
     }
 
+    // Check that the feature can be moved due to its dependencies
+    // i.e. Check that there are no features between the moved one and its destination
+    // with references to it
+    // Details on #21340 (old_id #660)
+
     // 1. Get features placed between selected and current in the document
     std::list<FeaturePtr> aFeaturesBetween = toCurrentFeatures(anObject);
     // if aFeaturesBetween is empty it means wrong order or anObject is the current feature