]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Model/Model_Tools.cpp
Salome HOME
Copyright update 2022
[modules/shaper.git] / src / Model / Model_Tools.cpp
index 48831807a3496897672b5b6809845bf6b5bc8fd3..eef04c1a238b30bb83e6e5ff453d20afea5233c4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -62,6 +62,8 @@ void Model_Tools::copyAttrs(TDF_Label theSource, TDF_Label theDestination,
     if (!theDestination.FindAttribute(anAttrIter.Value()->ID(), aTargetAttr)) {
       // create a new attribute if not yet exists in the destination
            aTargetAttr = anAttrIter.Value()->NewEmpty();
+      if (aTargetAttr->ID() != anAttrIter.Value()->ID())
+        aTargetAttr->SetID(anAttrIter.Value()->ID());
       theDestination.AddAttribute(aTargetAttr);
     }
     // no special relocation, empty map, but self-relocation is on: copy references w/o changes
@@ -126,6 +128,8 @@ void Model_Tools::copyAttrsAndKeepRefsToCoordinates(
     if (!theDestination.FindAttribute(anAttrIter.Value()->ID(), aTargetAttr)) {
       // create a new attribute if not yet exists in the destination
            aTargetAttr = anAttrIter.Value()->NewEmpty();
+      if (aTargetAttr->ID() != anAttrIter.Value()->ID())
+        aTargetAttr->SetID(anAttrIter.Value()->ID());
       theDestination.AddAttribute(aTargetAttr);
     }
     anAttrIter.Value()->Paste(aTargetAttr, theRelocTable);