]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp
Salome HOME
Fix for the import XAO unit test
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ImportFeature.cpp
index 4060c3e0495948dfdeb3be2f51009fa93c1963e6..d5eaf23603fbf028461b5a8a289d1b9f2995b5cf 100644 (file)
@@ -213,19 +213,12 @@ void ExchangePlugin_ImportFeature::removeFeature(
   if (!data()->isValid())
     return;
   AttributeRefListPtr aList = reflist(FEATURES_ID());
-  // if the object is last, remove it from the list (needed to skip empty transaction on edit of sketch feature)
-  if (aList->object(aList->size(true) - 1, true) == theFeature) {
-    aList->remove(theFeature);
-  } else {
-    // to keep the persistent sub-elements indexing, do not remove elements from list,
-    // but substitute by nulls
-    aList->substitute(theFeature, ObjectPtr());
-  }
+  aList->remove(theFeature);
 }
 
 int ExchangePlugin_ImportFeature::numberOfSubs(bool forTree) const
 {
-  return data()->reflist(FEATURES_ID())->size(false);
+  return data()->reflist(FEATURES_ID())->size(true);
 }
 
 std::shared_ptr<ModelAPI_Feature> ExchangePlugin_ImportFeature::subFeature(