Salome HOME
setDisplayed has to be called in order to synchronize internal state of the object
[modules/shaper.git] / src / Model / Model_AttributeSelectionList.cpp
index 24a9efca5308d5684d3030a0b55c6ac5d4fd8f54..3b67df9eb0a9063e23a7874fde696432fdaa9857 100644 (file)
@@ -39,6 +39,7 @@ void Model_AttributeSelectionList::append(
   if (owner()) {
     aNewAttr->setObject(owner());
   }
+  aNewAttr->setID(id());
   mySize->Set(aNewTag);
   aNewAttr->setValue(theContext, theSubShape);
   owner()->data()->sendAttributeUpdated(this);
@@ -101,6 +102,14 @@ void Model_AttributeSelectionList::clear()
   }
 }
 
+bool Model_AttributeSelectionList::isInitialized()
+{
+  if (size() == 0) { // empty list is not initialized list: sketch will be not valid after add/undo
+    return false;
+  }
+  return ModelAPI_AttributeSelectionList::isInitialized();
+}
+
 Model_AttributeSelectionList::Model_AttributeSelectionList(TDF_Label& theLabel)
 {
   myIsInitialized = theLabel.FindAttribute(TDataStd_Integer::GetID(), mySize) == Standard_True;