X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetDoubleValue.cpp;h=a17ea26c9793ee4a8c3acab86dc7f5df40b0646b;hb=cdc2caa21375bc96aaad9bb7c3ee1140dac1d738;hp=20f5224844cb33ea30be3c603640086a5fcd8071;hpb=cab404b68c3695181c4e83cb2623a7bedb623bda;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 20f522484..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,7 +118,7 @@ bool ModuleBase_WidgetDoubleValue::storeValueCustom() const DataPtr aData = myFeature->data(); AttributeDoublePtr aReal = aData->real(attributeID()); aReal->setValue(mySpinBox->value()); - std::string aTextRepr; + std::string aTextRepr = aReal->text(); if (mySpinBox->hasVariable()) { aTextRepr = mySpinBox->text().toStdString(); }