Salome HOME
Fix for registering parameters in command line mode
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetSelectorStore.cpp
index 2bf5195ca425248bdd51eb0aeead072a96662fb7..8c8c9b259c7f01416380926928a7fd5addda32eb 100755 (executable)
@@ -46,7 +46,8 @@ void ModuleBase_WidgetSelectorStore::storeAttributeValue(const AttributePtr& the
     myShape = ModuleBase_Tools::getShape(theAttribute, theWorkshop);
     myRefAttribute = AttributePtr();
     myIsObject = false;
-    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+    AttributeRefAttrPtr aRefAttr =
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
     if (aRefAttr) {
       myIsObject = aRefAttr->isObject();
       myRefAttribute = aRefAttr->attr();
@@ -60,7 +61,7 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t
 {
   std::string aType = theAttribute->attributeType();
   if (aType == ModelAPI_AttributeSelectionList::typeId()) {
-    AttributeSelectionListPtr aSelectionListAttr = 
+    AttributeSelectionListPtr aSelectionListAttr =
                    std::dynamic_pointer_cast<ModelAPI_AttributeSelectionList>(theAttribute);
     aSelectionListAttr->setSelectionType(mySelectionType);
     // restore selection in the attribute. Indeed there is only one stored object
@@ -69,7 +70,7 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t
       aSelectionListAttr->removeLast();
   }
   else if (aType == ModelAPI_AttributeRefList::typeId()) {
-    AttributeRefListPtr aRefListAttr = 
+    AttributeRefListPtr aRefListAttr =
                          std::dynamic_pointer_cast<ModelAPI_AttributeRefList>(theAttribute);
     // restore objects in the attribute. Indeed there is only one stored object
     int aCountAppened = aRefListAttr->size() - mySelectionCount;
@@ -85,8 +86,9 @@ void ModuleBase_WidgetSelectorStore::restoreAttributeValue(const AttributePtr& t
       aRefAttrListAttr->removeLast();
   }
   else {
-    ModuleBase_Tools::setObject(theAttribute, myObject, myShape, theWorkshop, true);
-    AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
+    ModuleBase_Tools::setObject(theAttribute, myObject, myShape, theWorkshop, true, true);
+    AttributeRefAttrPtr aRefAttr =
+      std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(theAttribute);
     if (aRefAttr) {
       if (!myIsObject)
         aRefAttr->setAttr(myRefAttribute);