]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix for the issue #3143 : Number of parts is wrong for document with Linear copy
authormpv <mpv@opencascade.com>
Fri, 28 Feb 2020 11:43:55 +0000 (14:43 +0300)
committermpv <mpv@opencascade.com>
Fri, 28 Feb 2020 11:44:09 +0000 (14:44 +0300)
src/Model/Model_Objects.cpp

index 047a4c10586ec96004bdfa7487a6aa89d15ecceb..6d40674d33092660ed3366e92f1159483407c9d7 100644 (file)
@@ -1888,10 +1888,12 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set<FeaturePtr>& t
           if (aResIndex <= theFeature->results().size()) { // to avoid crash if previous execute
             // for index = 0 erases result
             std::shared_ptr<ModelAPI_ResultPart> aNewP = createPart(theFeature->data(), aResIndex);
-            theFeature->setResult(aNewP, aResIndex);
-            if (!aNewP->partDoc().get())
-              // create the part result: it is better to restore the previous result if possible
-              theFeature->execute();
+            if (!aNewP->data()->isDeleted()) {
+              theFeature->setResult(aNewP, aResIndex);
+              if (!aNewP->partDoc().get())
+                // create the part result: it is better to restore the previous result if possible
+                theFeature->execute();
+            }
           }
         } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) {
           ResultConstructionPtr aConstr = createConstruction(theFeature->data(), aResIndex);