Salome HOME
Incorrect dumping of parts with user-defined names (issue #1804)
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ExternalValidator.cpp
index 7b85871883d0e3a4cf2bcf4dcf3a0c9ea63e5401..9c9fc3345d4ecdcb345a66742990301d860d4d81 100644 (file)
@@ -7,13 +7,16 @@
 #include "SketchPlugin_ExternalValidator.h"
 #include "SketchPlugin_Feature.h"
 
+#include <Events_InfoMessage.h>
+
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Result.h>
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_AttributeRefAttr.h>
 
 bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute,
-                                          const std::list<std::string>& theArguments) const
+                                             const std::list<std::string>& theArguments,
+                                             Events_InfoMessage& theError) const
 {
   if (theArguments.size() != 1)
     return true;
@@ -27,8 +30,10 @@ bool SketchPlugin_ExternalValidator::isValid(const AttributePtr& theAttribute,
   bool isParameterExternal = isExternalAttribute(aFeature->attribute(aFrontArgument));
 
   // it is not possible that both features, attribute and attribute in parameter, are external
-  if (isAttributeExternal && isParameterExternal)
+  if (isAttributeExternal && isParameterExternal) {
+    theError = "Both features, attribute and attribute in parameter, are external.";
     return false;
+  }
   return true;
 }