From 896c5e9b05c9f2ff349a9de2dad3d0d503fa2848 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 3 Apr 2017 11:38:35 +0300 Subject: [PATCH] Fix for the issue #2078 : enable result of enabled feature only --- src/Model/Model_Objects.cpp | 3 --- src/ModelAPI/ModelAPI_Feature.cpp | 3 ++- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index dca740f6c..798e234c5 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1124,17 +1124,14 @@ void Model_Objects::updateResults(FeaturePtr theFeature, std::set& t if (!aNewP->partDoc().get()) // create the part result: it is better to restore the previous result if it is possible theFeature->execute(); - break; } else if (aGroup->Get() == ModelAPI_ResultConstruction::group().c_str()) { theFeature->execute(); // construction shapes are needed for sketch solver - break; } else if (aGroup->Get() == ModelAPI_ResultGroup::group().c_str()) { aNewBody = createGroup(theFeature->data(), aResIndex); } else if (aGroup->Get() == ModelAPI_ResultField::group().c_str()) { aNewBody = createField(theFeature->data(), aResIndex); } else if (aGroup->Get() == ModelAPI_ResultParameter::group().c_str()) { theFeature->attributeChanged("expression"); // just produce a value - break; } else { Events_InfoMessage("Model_Objects", "Unknown type of result is found in the document:") .arg(TCollection_AsciiString(aGroup->Get()).ToCString()).send(); diff --git a/src/ModelAPI/ModelAPI_Feature.cpp b/src/ModelAPI/ModelAPI_Feature.cpp index 73e0428d2..bb387f81c 100644 --- a/src/ModelAPI/ModelAPI_Feature.cpp +++ b/src/ModelAPI/ModelAPI_Feature.cpp @@ -55,7 +55,8 @@ void ModelAPI_Feature::setResult(const std::shared_ptr& theResu myResults.push_back(theResult); } // in any case result becomes enabled - theResult->setDisabled(theResult, false); + if (!isDisabled()) // disabled feature may be executed when it is added as not enabled (#2078) + theResult->setDisabled(theResult, false); } void ModelAPI_Feature::setResult(const std::shared_ptr& theResult, -- 2.39.2