From: nds Date: Mon, 13 Apr 2015 11:41:48 +0000 (+0300) Subject: Do not reset the value if the XML definition has no the default key for the attribute. X-Git-Tag: V_1.1.0~38^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d144b401e8f88a10ec6a51e1e9a920e78003cbf2;p=modules%2Fshaper.git Do not reset the value if the XML definition has no the default key for the attribute. --- diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index 20f522484..e131719f3 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(); + } } }