From: nds Date: Fri, 13 Feb 2015 15:04:56 +0000 (+0300) Subject: Issue #394 Undo-ing a Sketch element X-Git-Tag: V_1.1.0~188^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9c54fb01877c455abb5b5ff22e384468f795b328;p=modules%2Fshaper.git Issue #394 Undo-ing a Sketch element A fix for the default constraint distance value --- diff --git a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp index cd1cc4565..b18aa2089 100644 --- a/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp +++ b/src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp @@ -82,7 +82,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent, double aDefVal = QString::fromStdString(myDefaultValue).toDouble(&isOk); if (isOk) { mySpinBox->setValue(aDefVal); - } else if (aProp == DOUBLE_WDG_DEFAULT_COMPUTED){ + } else if (theData->getProperty(ATTR_DEFAULT) == DOUBLE_WDG_DEFAULT_COMPUTED){ myIsComputedDefault = true; } @@ -101,6 +101,9 @@ ModuleBase_WidgetDoubleValue::~ModuleBase_WidgetDoubleValue() void ModuleBase_WidgetDoubleValue::reset() { + if (myIsComputedDefault) + return; + bool isOk; double aDefValue = QString::fromStdString(myDefaultValue).toDouble(&isOk); mySpinBox->setValue(isOk ? aDefValue : 0.0);