-// 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>
#include <ModelAPI_AttributeValidator.h>
#include <ModelAPI_Document.h>
#include <ModelAPI_Events.h>
+#include <ModelAPI_ResultParameter.h>
#include <ModelAPI_Session.h>
#include <ModelAPI_Tools.h>
theNewName);
// Issue #588. No need for reevaluating expression.
// Moreover, current history may not contain necessary parameters.
- anExpressionAttribute->owner()->data()->blockSendAttributeUpdated(true);
+ bool aWasBlocked = anExpressionAttribute->owner()->data()->blockSendAttributeUpdated(true);
anExpressionAttribute->setValue(anExpressionString);
- anExpressionAttribute->owner()->data()->blockSendAttributeUpdated(false);
+ anExpressionAttribute->owner()->data()->blockSendAttributeUpdated(aWasBlocked);
}
void ParametersPlugin_EvalListener::renameInAttribute(
void setParameterName(ResultParameterPtr theResultParameter, const std::string& theName)
{
- theResultParameter->data()->blockSendAttributeUpdated(true);
+ bool aWasBlocked = theResultParameter->data()->blockSendAttributeUpdated(true);
theResultParameter->data()->setName(theName);
- theResultParameter->data()->blockSendAttributeUpdated(false, false);
+ theResultParameter->data()->blockSendAttributeUpdated(aWasBlocked, false);
std::shared_ptr<ParametersPlugin_Parameter> aParameter =
std::dynamic_pointer_cast<ParametersPlugin_Parameter>(
ModelAPI_Feature::feature(theResultParameter));
- aParameter->data()->blockSendAttributeUpdated(true);
+ std::string anOldName = aParameter->name();
+ aWasBlocked = aParameter->data()->blockSendAttributeUpdated(true);
aParameter->data()->setName(theName);
aParameter->string(ParametersPlugin_Parameter::VARIABLE_ID())->setValue(theName);
- aParameter->data()->blockSendAttributeUpdated(false);
+ aParameter->data()->blockSendAttributeUpdated(aWasBlocked);
}
void ParametersPlugin_EvalListener::processObjectRenamedEvent(