From: nds Date: Mon, 16 Feb 2015 13:46:42 +0000 (+0300) Subject: Issue #394 Undo-ing a Sketch element X-Git-Tag: V_1.1.0~180 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e309d5c7d3a7a0e1298abd735f385fa6653e829;p=modules%2Fshaper.git Issue #394 Undo-ing a Sketch element Check the value on initialized and do not set new value if it was initialized. --- diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index d332eedc7..6351c4f78 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -99,14 +99,17 @@ void ModuleBase_ModelWidget::activate() // the control value is stored to the mode by the focus in on the widget // we need the value is initialized in order to enable the apply button in the property panel. // It should happens in the creation mode only because all fields are filled in the edition mode - if (!isEditingMode()/* && !myFeature->data()->attribute(myAttributeID)->isInitialized()*/) { - if (isComputedDefault()) { - if (myFeature->compute(myAttributeID)) { - restoreValue(); - } - } - else { - storeValue(); + if (!isEditingMode()) { + AttributePtr anAttribute = myFeature->data()->attribute(myAttributeID); + if (anAttribute.get() != NULL && !anAttribute->isInitialized()) { + if (isComputedDefault()) { + if (myFeature->compute(myAttributeID)) { + restoreValue(); + } + } + else { + storeValue(); + } } } activateCustom();