Salome HOME
Fix and unit test for the issue #1064
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.cpp
index 07e62e2bcf45bcad212b5e9c1995413d16e13bf7..f762ebaf39699e006fc32d8f45ceab799528bdf0 100644 (file)
@@ -50,7 +50,8 @@ void Model_AttributeSelectionList::append(
   owner()->data()->sendAttributeUpdated(this);
 }
 
-void Model_AttributeSelectionList::append(std::string theNamingName)
+void Model_AttributeSelectionList::append(
+  const std::string theNamingName, const std::string& theType)
 {
   int aNewTag = mySize->Get() + 1;
   TDF_Label aNewLab = mySize->Label().FindChild(aNewTag);
@@ -60,8 +61,9 @@ void Model_AttributeSelectionList::append(std::string theNamingName)
   if (owner()) {
     aNewAttr->setObject(owner());
   }
+  aNewAttr->setID(id());
   mySize->Set(aNewTag);
-  aNewAttr->selectSubShape(selectionType(), theNamingName);
+  aNewAttr->selectSubShape(theType.empty() ? selectionType() : theType, theNamingName);
   owner()->data()->sendAttributeUpdated(this);
 }