X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FExchangePlugin%2FExchangePlugin_ImportFeature.cpp;h=4107115ce918ce816768289e9e340a3442d3bf73;hb=0213528bdfe5b97da3a23e34361d69944b825ffb;hp=4060c3e0495948dfdeb3be2f51009fa93c1963e6;hpb=da08ab63a0b7be551ef70d25ac11e0bd3bcbcf96;p=modules%2Fshaper.git diff --git a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp index 4060c3e04..4107115ce 100644 --- a/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ImportFeature.cpp @@ -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(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 ExchangePlugin_ImportFeature::subFeature(