From: vsv Date: Fri, 28 Nov 2014 12:13:37 +0000 (+0300) Subject: Improvement of shape selector X-Git-Tag: V_0.6.0^2~50 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a941c5bfc2b824d694d8312cba6d58a55cc8ba8a;p=modules%2Fshaper.git Improvement of shape selector --- diff --git a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp index 12cb98980..74294d9a4 100644 --- a/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp @@ -135,17 +135,21 @@ bool ModuleBase_WidgetShapeSelector::storeValue() const if (aBody) { AttributePtr aAttr = aData->attribute(attributeID()); + // We have to check several attributes types AttributeSelectionPtr aSelectAttr = std::dynamic_pointer_cast(aAttr); - if (aSelectAttr) + if (aSelectAttr) { aSelectAttr->setValue(aBody, myShape); - else { + updateObject(myFeature); + return true; + } else { AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID()); - if (aRefAttr) + if (aRefAttr) { aRefAttr->setObject(mySelectedObject); + updateObject(myFeature); + return true; + } } - updateObject(myFeature); - return true; } } else { AttributeReferencePtr aRef = aData->reference(attributeID()); @@ -181,6 +185,11 @@ bool ModuleBase_WidgetShapeSelector::restoreValue() if (aSelect) { mySelectedObject = aSelect->context(); myShape = aSelect->value(); + } else { + AttributeRefAttrPtr aRefAttr = aData->refattr(attributeID()); + if (aRefAttr) { + mySelectedObject = aRefAttr->object(); + } } } else { AttributeReferencePtr aRef = aData->reference(attributeID());