From: azv Date: Mon, 17 Jun 2019 11:23:31 +0000 (+0300) Subject: Fix regression in Recover feature during HDF reading. X-Git-Tag: VEDF2019Lot4~112 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8d394d6cade9024cea6cf75acafd758506a789d8;p=modules%2Fshaper.git Fix regression in Recover feature during HDF reading. --- diff --git a/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp b/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp index 4cf0a75c3..bae08ab42 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Recover.cpp @@ -34,6 +34,7 @@ #include FeaturesPlugin_Recover::FeaturesPlugin_Recover() + : myClearListOnTypeChange(true) { } @@ -43,6 +44,11 @@ void FeaturesPlugin_Recover::initAttributes() data()->addAttribute(RECOVERED_ENTITIES(), ModelAPI_AttributeRefList::typeId()); data()->addAttribute(METHOD(), ModelAPI_AttributeString::typeId()); + if (!string(METHOD())->isInitialized()) { + myClearListOnTypeChange = false; + string(METHOD())->setValue(METHOD_DEFAULT()); + myClearListOnTypeChange = true; + } ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), METHOD()); // set default method for recovering string(METHOD())->setValue(METHOD_DEFAULT()); @@ -89,6 +95,6 @@ void FeaturesPlugin_Recover::execute() void FeaturesPlugin_Recover::attributeChanged(const std::string& theID) { - if (theID == METHOD()) + if (theID == METHOD() && myClearListOnTypeChange) reflist(RECOVERED_ENTITIES())->clear(); } diff --git a/src/FeaturesPlugin/FeaturesPlugin_Recover.h b/src/FeaturesPlugin/FeaturesPlugin_Recover.h index ac2de898c..8f2377445 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Recover.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Recover.h @@ -38,6 +38,8 @@ class FeaturesPlugin_Recover : public ModelAPI_Feature FeaturePtr myCurrentBase; /// previous state of persistent flag bool myPersistent; + /// necessity to clean recovered list while changing the type of recover + bool myClearListOnTypeChange; public: /// Extrusion kind inline static const std::string& ID()