]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/Selector/Selector_Container.cpp
Salome HOME
Merge remote-tracking branch 'remotes/origin/EDF_2020_Lot2'
[modules/shaper.git] / src / Selector / Selector_Container.cpp
index 05f8fa2ea3a69543c4565d7cf183c41d9ad10c6f..df69d787530bddc65e6b38d243cda0004ac0224f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  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
@@ -70,7 +70,6 @@ bool Selector_Container::restore()
     return false;
   myShapeType = TopAbs_ShapeEnum(aShapeTypeAttr->Get());
   // restore sub-selectors
-  bool aSubResult = true;
   for(TDF_ChildIterator aSub(label(), false); aSub.More(); aSub.Next()) {
     Selector_Algo* aSubSel = restoreByLab(aSub.Value(), baseDocument());
     if (!append(aSubSel, false)) {
@@ -85,19 +84,19 @@ TDF_Label Selector_Container::restoreByName(std::wstring theName,
 {
   myShapeType = theShapeType;
   TDF_Label aContext;
-  for(size_t aStart = 0; aStart != std::string::npos; aStart = theName.find('[', aStart + 1)) {
-    size_t anEndPos = theName.find(']', aStart + 1);
-    if (anEndPos != std::string::npos) {
+  for(size_t aStart = 0; aStart != std::wstring::npos; aStart = theName.find('[', aStart + 1)) {
+    size_t anEndPos = theName.find(L']', aStart + 1);
+    if (anEndPos != std::wstring::npos) {
       // there could be sub-intersections, so, [[...]] case; searching for other open-bracket
-      size_t aNextStart = theName.find('[', aStart + 1);
-      while(aNextStart != std::string::npos && aNextStart < anEndPos) {
-        anEndPos = theName.find(']', anEndPos + 1);
-        if (anEndPos == std::string::npos) {
+      size_t aNextStart = theName.find(L'[', aStart + 1);
+      while(aNextStart != std::wstring::npos && aNextStart < anEndPos) {
+        anEndPos = theName.find(L']', anEndPos + 1);
+        if (anEndPos == std::wstring::npos) {
           return TDF_Label(); // invalid parentheses
         }
-        aNextStart = theName.find('[', aNextStart + 1);
+        aNextStart = theName.find(L'[', aNextStart + 1);
       }
-      if (anEndPos == std::string::npos)
+      if (anEndPos == std::wstring::npos)
         return TDF_Label(); // invalid parentheses
       std::wstring aSubStr = theName.substr(aStart + 1, anEndPos - aStart - 1);
       TopAbs_ShapeEnum aSubShapeType = TopAbs_FACE;
@@ -161,6 +160,8 @@ bool Selector_Container::solve(const TopoDS_Shape& theContext)
     aResult = aWire;
     break;
   }
+  default:
+    break;
   }
   TopoDS_ListOfShape aSubSelectorShapes;
   std::list<Selector_Algo*>::const_iterator aSubSel = list().cbegin();