From d144b401e8f88a10ec6a51e1e9a920e78003cbf2 Mon Sep 17 00:00:00 2001 From: nds Date: Mon, 13 Apr 2015 14:41:48 +0300 Subject: [PATCH] Do not reset the value if the XML definition has no the default key for the attribute. --- src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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(); + } } } -- 2.39.2