Salome HOME
Make correct management of concealed on history position changes (on edit, manual...
[modules/shaper.git] / src / Model / Model_ResultPart.cpp
index 5216e6107e6ad8639f2d9ac374ff60407d0e1211..a376cc88f1af8f486ef95d7013ed7478e158792f 100644 (file)
@@ -78,7 +78,7 @@ bool Model_ResultPart::setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
 {
   if (ModelAPI_ResultPart::setDisabled(theThis, theFlag)) {
     DocumentPtr aDoc = Model_ResultPart::partDoc();
-    if (aDoc.get()) {
+    if (aDoc.get() && aDoc->isOpened()) {
       // make the current feature the last in any case: to update shapes defore deactivation too
       FeaturePtr aLastFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aDoc->object(
         ModelAPI_Feature::group(), aDoc->size(ModelAPI_Feature::group()) - 1));