Salome HOME
Comment Split output
[modules/shaper.git] / src / ExchangePlugin / ExchangePlugin_ImportFeature.cpp
index 4060c3e0495948dfdeb3be2f51009fa93c1963e6..4107115ce918ce816768289e9e340a3442d3bf73 100644 (file)
@@ -187,6 +187,9 @@ void ExchangePlugin_ImportFeature::importXAO(const std::string& theFileName)
       aSelectionList->value(anElementIndex)->setId(aReferenceID);
     }
   }
+  // Top avoid problems in Object Browser update: issue #1647.
+  ModelAPI_EventCreator::get()->sendReordered(
+    std::dynamic_pointer_cast<ModelAPI_Feature>(aRefListOfGroups->owner()));
 
   } catch (XAO::XAO_Exception& e) {
     std::string anError = e.what();
@@ -213,19 +216,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(