From: vsv Date: Wed, 25 Jul 2018 14:49:17 +0000 (+0300) Subject: Issue #2571: Clear error flag if the control is initialized from the attribute X-Git-Tag: SHAPER_V9_1_0RC1~106 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1631e78ccd2924167444bca66d478d39552b210f;p=modules%2Fshaper.git Issue #2571: Clear error flag if the control is initialized from the attribute --- diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 0adf8f355..2b8325115 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -179,6 +179,10 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() // it is important to set the empty text value to the attribute before set the value // because setValue tries to calculate the attribute value according to the // attribute current text + if (aReal->expressionInvalid()) { + aReal->setExpressionError(""); + aReal->setExpressionInvalid(false); + } aReal->setText(""); aReal->setValue(mySpinBox->value()); } @@ -208,6 +212,10 @@ bool ModuleBase_WidgetDoubleValue::restoreValueCustom() ModuleBase_Tools::setSpinText(mySpinBox, aText); } else { ModuleBase_Tools::setSpinValue(mySpinBox, aRef->isInitialized() ? aRef->value() : 0); + if (aRef->isInitialized() && aRef->expressionInvalid()) { + aRef->setExpressionError(""); + aRef->setExpressionInvalid(false); + } } return true; }