Salome HOME
updated copyright message
[modules/shaper.git] / src / Selector / Selector_Primitive.cpp
index a2d141066f40cf0e3f8f3d84984fc44154813139..d36cc05618b04290f81933892d867f383f321ba4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include <Selector_Primitive.h>
 
 #include <Selector_NameGenerator.h>
 
+#include <Locale_Convert.h>
+
 #include <TNaming_NamedShape.hxx>
 #include <TDataStd_Name.hxx>
 
@@ -48,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)) {
@@ -73,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;
 }