X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetDoubleValue.cpp;h=a17ea26c9793ee4a8c3acab86dc7f5df40b0646b;hb=af851100774c4ff33b515c884abe0cd03c3f0528;hp=0b5c4e681e8933da8ce7c8ef9ed67b56417d9281;hpb=150ef68b3ea2df3c2130a4f5ea8128ddb5c76048;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 0b5c4e681..a17ea26c9 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -104,8 +104,12 @@ void ModuleBase_WidgetDoubleValue::reset() else { bool isOk; double aDefValue = QString::fromStdString(getDefaultValue()).toDouble(&isOk); - ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0); - storeValueCustom(); + // reset the value just if there is a default value definition in the XML definition + // if the double value can not be found by the default value, do nothing + if (isOk) { + ModuleBase_Tools::setSpinValue(mySpinBox, isOk ? aDefValue : 0.0); + storeValueCustom(); + } } } @@ -114,8 +118,8 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() const DataPtr aData = myFeature->data(); AttributeDoublePtr aReal = aData->real(attributeID()); aReal->setValue(mySpinBox->value()); - std::string aTextRepr; - if (mySpinBox->hasVariables()) { + std::string aTextRepr = aReal->text(); + if (mySpinBox->hasVariable()) { aTextRepr = mySpinBox->text().toStdString(); } aReal->setText(aTextRepr);