Salome HOME
Issue #18944: Cannot delete Part
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Fri, 3 Apr 2020 14:26:29 +0000 (17:26 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Fri, 3 Apr 2020 14:26:29 +0000 (17:26 +0300)
Make PartSet active document when removing a Part.

src/PartSetPlugin/PartSetPlugin_Remove.cpp

index dee53bf5600c1e2fac4ceabc4d5b34968c4f0fef..a17bfee5ebb137265ba6b503da1c4e8d34c36a35 100644 (file)
@@ -46,6 +46,8 @@ void PartSetPlugin_Remove::execute()
       std::set<std::shared_ptr<ModelAPI_Feature> > aRefFeatures;
       aRoot->refsToFeature(aFeature, aRefFeatures);
       if (aRefFeatures.empty()) {
+        // before removing the part make the partSet active document
+        aPManager->setActiveDocument(aRoot);
         aRoot->removeFeature(aFeature);
         // the redisplay signal should be flushed in order to erase the feature presentation
         // in the viewer after removeFeature from the document