From: sbh Date: Thu, 27 Nov 2014 11:10:19 +0000 (+0300) Subject: Issue #278 Threat "Action" features as valid, even if it has no data. X-Git-Tag: V_0.6.0^2~58 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dc1946c16b28ef51b9dab62c8ff3fc405ff1f113;p=modules%2Fshaper.git Issue #278 Threat "Action" features as valid, even if it has no data. --- diff --git a/src/Model/Model_FeatureValidator.cpp b/src/Model/Model_FeatureValidator.cpp index 2bbad12d1..9f3ab4a13 100644 --- a/src/Model/Model_FeatureValidator.cpp +++ b/src/Model/Model_FeatureValidator.cpp @@ -15,8 +15,10 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr& th const std::list& theArguments) const { std::shared_ptr aData = theFeature->data(); - if (!aData) - return false; + // "Action" features has no data, but still valid. e.g "Remove Part" + if (!aData) { + return theFeature->isAction(); + } if (!aData->isValid()) return false; const std::string kAllTypes = ""; diff --git a/src/Model/Model_Validator.cpp b/src/Model/Model_Validator.cpp index 501b91b2f..d8967d0e6 100644 --- a/src/Model/Model_Validator.cpp +++ b/src/Model/Model_Validator.cpp @@ -175,10 +175,12 @@ bool Model_ValidatorsFactory::validate(const std::shared_ptr& return false; } } + // check all attributes for validity std::shared_ptr aData = theFeature->data(); - if (!aData || !aData->isValid()) - return false; + // Validity of data is checked by "Model_FeatureValidator" (kDefaultId) + // if (!aData || !aData->isValid()) + // return false; static const std::string kAllTypes = ""; std::map >::const_iterator aFeatureIter = myAttrs.find(theFeature->getKind());