From f41113f31c3ba293a17e8dc48ae9cc4de9b575dd Mon Sep 17 00:00:00 2001 From: azv Date: Thu, 20 Feb 2020 13:32:35 +0300 Subject: [PATCH] Issue #18733: Impossible to insert a feature into the previous folder Check if the folder has features not in history at the end --- src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp | 2 ++ src/Model/Model_Objects.cpp | 13 ++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp index ca42c50ea..81a78f0d8 100644 --- a/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp +++ b/src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp @@ -110,11 +110,13 @@ void ExchangePlugin_ExportFeature::initAttributes() // if the type of export operation is XAO AttributeStringPtr aTypeAttr = string(EXPORT_TYPE_ID()); if (aTypeAttr->isInitialized() && aTypeAttr->value() == "XAO") { + bool aWasBlocked = data()->blockSendAttributeUpdated(true, false); AttributeSelectionListPtr aSelList = selectionList(SELECTION_LIST_ID()); AttributeSelectionListPtr aXAOSelList = selectionList(XAO_SELECTION_LIST_ID()); if (aSelList->size() > 0 && aXAOSelList->size() == 0) aSelList->copyTo(aXAOSelList); aSelList->clear(); + data()->blockSendAttributeUpdated(aWasBlocked, false); } } diff --git a/src/Model/Model_Objects.cpp b/src/Model/Model_Objects.cpp index 152aaaeb8..047a4c105 100644 --- a/src/Model/Model_Objects.cpp +++ b/src/Model/Model_Objects.cpp @@ -1490,17 +1490,20 @@ std::shared_ptr Model_Objects::findFolder( if (theBelow) continue; - // if feature is in sub-component, skip it - FeaturePtr aCurFeature = feature(aCurLabel); - if (isSkippedFeature(aCurFeature)) - continue; - + // issue #18733: check for the last feature in folder before checking the sub-feature, + // because the folder may end by the feature which is + // neither a sub-feature nor a feature in history. if (!aLastFeatureInFolder.IsNull()) { if (IsEqual(aCurLabel, aLastFeatureInFolder)) aLastFeatureInFolder.Nullify(); // the last feature in the folder is achieved continue; } + // if feature is in sub-component, skip it + FeaturePtr aCurFeature = feature(aCurLabel); + if (isSkippedFeature(aCurFeature)) + continue; + const ObjectPtr& aFolderObj = folder(aCurLabel); if (aFolderObj.get()) { aFoundFolder = std::dynamic_pointer_cast(aFolderObj); -- 2.39.2