X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_ValidatorTransform.cpp;h=41dd47afb9751f5bb55b8d04786caf88f0460ebb;hb=ca925f26180f15699a77e76461679f11abd499ba;hp=c7a92abe0770665841df82b4a868d8ca0bbb50f6;hpb=7569b92a8570dab734c5336241457bec4f2cdb1c;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp index c7a92abe0..41dd47afb 100755 --- a/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_ValidatorTransform.cpp @@ -1,4 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D +// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or +// email : webmaster.salome@opencascade.com +// #include "FeaturesPlugin_ValidatorTransform.h" @@ -22,7 +40,7 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute return false; } - std::shared_ptr aCurSelList = + std::shared_ptr aCurSelList = std::dynamic_pointer_cast(theAttribute); DocumentPtr aDocument = theAttribute->owner()->document(); @@ -33,7 +51,10 @@ bool FeaturesPlugin_ValidatorTransform::isValid(const AttributePtr& theAttribute for(int i = 0; i < aCurSelList->size() && aValid; i++) { std::shared_ptr aSelAttribute = aCurSelList->value(i); ResultPtr aResult = aSelAttribute->context(); - if (isPartSetDocument) // PartSet document: Result Part is valid + if (!aResult) { + theError = "Invalid selection."; + return false; + } if (isPartSetDocument) // PartSet document: Result Part is valid aValid = aResult->groupName() == ModelAPI_ResultPart::group(); else { // Part document: Result CompSolid is valid aValid = aResult->groupName() == ModelAPI_ResultBody::group();