Salome HOME
[Code coverage ParametersPlugin]: Unit tests for parameter remove and for error treating
[modules/shaper.git] / src / ParametersPlugin / ParametersPlugin_EvalListener.cpp
index ef8fa81fb4307999b8086eec468719996af2cc19..cc299083317be073bda56b3ab5da4bda2d24feca 100644 (file)
@@ -1,10 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
-/*
- * ParametersPlugin_EvalListener.cpp
- *
- *  Created on: Apr 28, 2015
- *      Author: sbh
- */
+// 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<mailto:webmaster.salome@opencascade.com>
+//
 
 #include <pyconfig.h>
 
@@ -20,6 +32,7 @@
 #include <ModelAPI_AttributeValidator.h>
 #include <ModelAPI_Document.h>
 #include <ModelAPI_Events.h>
+#include <ModelAPI_ResultParameter.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Tools.h>
 
@@ -237,6 +250,7 @@ void setParameterName(ResultParameterPtr theResultParameter, const std::string&
       std::dynamic_pointer_cast<ParametersPlugin_Parameter>(
           ModelAPI_Feature::feature(theResultParameter));
 
+  std::string anOldName = aParameter->name();
   aWasBlocked = aParameter->data()->blockSendAttributeUpdated(true);
   aParameter->data()->setName(theName);
   aParameter->string(ParametersPlugin_Parameter::VARIABLE_ID())->setValue(theName);