Salome HOME
[bos #32342] EDF 26130 - Undo and auxiliarity
[modules/shaper.git] / src / Selector / Selector_Primitive.cpp
index bb2b1f737d3c8bee0c2351117bbc594d356362a2..60b8d7f7dce9b02ed591ddd6f2175e1c32e19b85 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
@@ -21,6 +21,8 @@
 
 #include <Selector_NameGenerator.h>
 
+#include <Locale_Convert.h>
+
 #include <TNaming_NamedShape.hxx>
 #include <TDataStd_Name.hxx>
 
@@ -47,8 +49,8 @@ bool Selector_Primitive::restore()
   return restoreBaseArray(anEmptyRefList, myFinal);
 }
 
-TDF_Label Selector_Primitive::restoreByName(std::string theName,
-  const TopAbs_ShapeEnum theShapeType, Selector_NameGenerator* theNameGenerator)
+TDF_Label Selector_Primitive::restoreByName(std::wstring theName,
+  const TopAbs_ShapeEnum /*theShapeType*/, Selector_NameGenerator* theNameGenerator)
 {
   TDF_Label aContext;
   if (theNameGenerator->restoreContext(theName, aContext, myFinal)) {
@@ -72,13 +74,15 @@ bool Selector_Primitive::solve(const TopoDS_Shape& theContext)
   return false;
 }
 
-std::string Selector_Primitive::name(Selector_NameGenerator* theNameGenerator)
+std::wstring Selector_Primitive::name(Selector_NameGenerator* theNameGenerator)
 {
   Handle(TDataStd_Name) aName;
   if (!myFinal.FindAttribute(TDataStd_Name::GetID(), aName))
-    return "";
-  std::string aResult = theNameGenerator->contextName(myFinal);
-  if (!aResult.empty())
-    aResult += "/" + std::string(TCollection_AsciiString(aName->Get()).ToCString());
+    return L"";
+  std::wstring aResult = theNameGenerator->contextName(myFinal);
+  if (!aResult.empty()) {
+    aResult += L"/";
+    aResult += Locale::Convert::toWString(aName->Get().ToExtString());
+  }
   return aResult;
 }