Salome HOME
Updated copyright comment
[modules/shaper.git] / src / Selector / Selector_Algo.cpp
index a21be5fa5dac83eb8cb6cc3e33aa24765bf4b2d8..1caf2428bcb1d77108921b1077e9a5196d88f35b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -410,11 +410,11 @@ Selector_Algo* Selector_Algo::restoreByLab(TDF_Label theLab, TDF_Label theBaseDo
 }
 
 Selector_Algo* Selector_Algo::restoreByName(TDF_Label theLab, TDF_Label theBaseDocLab,
-  std::string theName, const TopAbs_ShapeEnum theShapeType, const bool theGeomNaming,
+  std::wstring theName, const TopAbs_ShapeEnum theShapeType, const bool theGeomNaming,
   Selector_NameGenerator* theNameGenerator, TDF_Label& theContextLab)
 {
   Selector_Algo* aResult = NULL;
-  if (theName[0] == '[') { // intersection or container
+  if (theName[0] == L'[') { // intersection or container
     switch(theShapeType) {
     case TopAbs_COMPOUND:
     case TopAbs_COMPSOLID:
@@ -429,12 +429,12 @@ Selector_Algo* Selector_Algo::restoreByName(TDF_Label theLab, TDF_Label theBaseD
       break;
     default:;
     }
-  } else if (theName[0] == '(') { // filter by neighbors
+  } else if (theName[0] == L'(') { // filter by neighbors
     aResult = new Selector_FilterByNeighbors;
   } else if (theName.find(pureWeakNameID()) == 0 ||
              theName.find(oldPureWeakNameID()) == 0) { // weak naming identifier
     aResult = new Selector_WeakName;
-  } else if (theName.find('&') != std::string::npos) { // modification
+  } else if (theName.find(L'&') != std::wstring::npos) { // modification
     aResult = new Selector_Modify;
   } else { // primitive
     aResult = new Selector_Primitive;
@@ -502,13 +502,15 @@ bool Selector_Algo::findNewVersion(const TopoDS_Shape& theContext, TopoDS_Shape&
         TopoDS_Shape aNextModification = aBaseIter.Shape();
         if (aNextModification.IsNull())
           continue;
-        if (isInContext(theContext, aNextModification))
+        if (isInContext(theContext, aNextModification)) {
           // don't add vertices generated from edges
           if (aNextModification.ShapeType() <= theResult.ShapeType())
             aResultShapes.Add(aNextModification);
-        else if (findNewVersion(theContext, aNextModification))
+        }
+        else if (findNewVersion(theContext, aNextModification)) {
           if (aNextModification.ShapeType() <= theResult.ShapeType())
             aResultShapes.Add(aNextModification);
+        }
       }
     }
     if (aResultShapes.IsEmpty())