]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #18733: Impossible to insert a feature into the previous folder
authorazv <azv@opencascade.com>
Thu, 20 Feb 2020 10:32:35 +0000 (13:32 +0300)
committerazv <azv@opencascade.com>
Thu, 20 Feb 2020 10:33:24 +0000 (13:33 +0300)
Check if the folder has features not in history at the end

src/ExchangePlugin/ExchangePlugin_ExportFeature.cpp
src/Model/Model_Objects.cpp

index ca42c50ea082ebb0bac8b35122d1c8fd22a15d91..81a78f0d8cc3ad574baa4497d7133584ac9af7ce 100644 (file)
@@ -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);
   }
 }
 
index 152aaaeb84ee27a8c4211c1c3d3618dae7221f50..047a4c10586ec96004bdfa7487a6aa89d15ecceb 100644 (file)
@@ -1490,17 +1490,20 @@ std::shared_ptr<ModelAPI_Folder> 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<ModelAPI_Folder>(aFolderObj);