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();
+ }
}
}
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);