]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModelHighAPI/ModelHighAPI_Dumper.cpp
Salome HOME
Issue #3237: Allow usage of accented characters in ObjectBrowser
[modules/shaper.git] / src / ModelHighAPI / ModelHighAPI_Dumper.cpp
index d818d9406ef3e62e5dcb257b221805183cdf8fde..6d8affba893069289e3e0b5ae1a3b8d62f4a3d9c 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
@@ -161,7 +161,7 @@ public:
   /// Dump std::endl
   friend
   DumpStorageBuffer& operator<<(DumpStorageBuffer& theBuffer,
-                                std::basic_ostream<char>& (*theEndl)(std::basic_ostream<char>&))
+                                std::basic_ostream<char>& (*)(std::basic_ostream<char>&))
   {
     theBuffer.write("\n");
     return theBuffer;
@@ -641,10 +641,10 @@ const std::string& ModelHighAPI_Dumper::name(const EntityPtr& theEntity,
       int aFullIndex = 0;
       NbFeaturesMap::const_iterator aFIt = myFeatureCount.begin();
       for (; aFIt != myFeatureCount.end(); ++aFIt) {
-        std::map<std::string, std::pair<int, int> >::const_iterator aFound =
+        std::map<std::string, std::pair<int, int> >::const_iterator aFoundKind =
           aFIt->second.find(aKind);
-        if (aFound != aFIt->second.end())
-          aFullIndex += aFound->second.first;
+        if (aFoundKind != aFIt->second.end())
+          aFullIndex += aFoundKind->second.first;
       }
       aDefaultName << aKind << "_" << aFullIndex;
     }
@@ -684,7 +684,6 @@ void ModelHighAPI_Dumper::saveResultNames(const FeaturePtr& theFeature)
   bool isFeatureDefaultName = myNames[theFeature].myIsDefault;
 
   // Save only names of results which is not correspond to default feature name
-  const std::list<ResultPtr>& aResults = theFeature->results();
   std::list<ResultPtr> allRes;
   ModelAPI_Tools::allResults(theFeature, allRes);
   for(std::list<ResultPtr>::iterator aRes = allRes.begin(); aRes != allRes.end(); aRes++) {
@@ -1145,7 +1144,11 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
 {
   static const int aSize = 3;
   double aValues[aSize] = {thePoint->x(), thePoint->y(), thePoint->z()};
-  std::string aTexts[aSize] = {thePoint->textX(), thePoint->textY(), thePoint->textZ()};
+  std::string aTexts[aSize] = {
+      Locale::Convert::toString(thePoint->textX()),
+      Locale::Convert::toString(thePoint->textY()),
+      Locale::Convert::toString(thePoint->textZ())
+  };
   myDumpStorage->dumpArray(aSize, aValues, aTexts);
   return *this;
 }
@@ -1155,7 +1158,10 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
 {
   static const int aSize = 2;
   double aValues[aSize] = {thePoint->x(), thePoint->y()};
-  std::string aTexts[aSize] = {thePoint->textX(), thePoint->textY()};
+  std::string aTexts[aSize] = {
+      Locale::Convert::toString(thePoint->textX()),
+      Locale::Convert::toString(thePoint->textY())
+  };
   myDumpStorage->dumpArray(aSize, aValues, aTexts);
   return *this;
 }
@@ -1207,7 +1213,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
 ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
     const std::shared_ptr<ModelAPI_AttributeInteger>& theAttrInt)
 {
-  std::string aText = theAttrInt->text();
+  std::string aText = Locale::Convert::toString(theAttrInt->text());
   if (aText.empty())
     *myDumpStorage << theAttrInt->value();
   else
@@ -1232,7 +1238,7 @@ ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
 ModelHighAPI_Dumper& ModelHighAPI_Dumper::operator<<(
     const std::shared_ptr<ModelAPI_AttributeDouble>& theAttrReal)
 {
-  std::string aText = theAttrReal->text();
+  std::string aText = Locale::Convert::toString(theAttrReal->text());
   if (aText.empty())
     *myDumpStorage << theAttrReal->value();
   else
@@ -1656,7 +1662,7 @@ void ModelHighAPI_Dumper::exportVariables() const
         exportVariable(anEntry, aNameIter->second.myCurrentName);
         size_t aSize = aFeature->results().size();
         if (aSize > 1) { // additional entries for features with more than one result
-          for(int a = 1; a < aSize; a++) {
+          for(size_t a = 1; a < aSize; a++) {
             std::ostringstream aResEntryStr;
             aResEntryStr<<anEntry<<":"<<a;
             std::string aResEntry = aResEntryStr.str();