X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSketchPlugin%2FSketchPlugin_Tools.cpp;h=ef885ec1e3ab7390ae9c86fd8edab3eee20da1a7;hb=cdbbde4803e9c320204d537d22af4ac7ef024962;hp=ed4084afe60dfdeab7e3325746e7afbee31275da;hpb=a0fa395fd2a0ddb16cb9aed4dab180f2681b4447;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_Tools.cpp b/src/SketchPlugin/SketchPlugin_Tools.cpp index ed4084afe..ef885ec1e 100644 --- a/src/SketchPlugin/SketchPlugin_Tools.cpp +++ b/src/SketchPlugin/SketchPlugin_Tools.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2020 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 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 @@ -37,8 +37,11 @@ #include +#include + #include #include +#include #include #include @@ -62,17 +65,17 @@ namespace SketchPlugin_Tools { void clearExpressions(AttributeDoublePtr theAttribute) { - theAttribute->setText(std::string()); + theAttribute->setText(std::wstring()); } void clearExpressions(AttributePointPtr theAttribute) { - theAttribute->setText(std::string(), std::string(), std::string()); + theAttribute->setText(std::wstring(), std::wstring(), std::wstring()); } void clearExpressions(AttributePoint2DPtr theAttribute) { - theAttribute->setText(std::string(), std::string()); + theAttribute->setText(std::wstring(), std::wstring()); } void clearExpressions(AttributePtr theAttribute) @@ -273,7 +276,8 @@ private: std::set aCoincToRes = SketchPlugin_Tools::findCoincidentConstraints(theFeature->lastResult()); aCoincidences.insert(aCoincToRes.begin(), aCoincToRes.end()); - } std::set::const_iterator aCIt = aCoincidences.begin(); + } + std::set::const_iterator aCIt = aCoincidences.begin(); for (; aCIt != aCoincidences.end(); ++aCIt) { if (theCoincidences.find(*aCIt) != theCoincidences.end()) @@ -544,7 +548,8 @@ void createAuxiliaryPointOnEllipse(const FeaturePtr& theEllipseFeature, aCoord->setValue(anElPoint->x(), anElPoint->y()); aPointFeature->execute(); - std::string aName = theEllipseFeature->name() + "_" + theEllipsePoint; + std::wstring aName = theEllipseFeature->name() + L"_" + + Locale::Convert::toWString(theEllipsePoint); aPointFeature->data()->setName(aName); aPointFeature->lastResult()->data()->setName(aName); @@ -577,8 +582,8 @@ void createAuxiliaryAxisOfEllipse(const FeaturePtr& theEllipseFeature, aLineEnd->setValue(aEndPoint->x(), aEndPoint->y()); aLineFeature->execute(); - std::string aName = theEllipseFeature->name() + "_" + - (theStartPoint == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID() ? "major_axis" : "minor_axis"); + std::wstring aName = theEllipseFeature->name() + L"_" + + (theStartPoint == SketchPlugin_Ellipse::MAJOR_AXIS_START_ID() ? L"major_axis" : L"minor_axis"); aLineFeature->data()->setName(aName); aLineFeature->lastResult()->data()->setName(aName); @@ -645,13 +650,13 @@ void setDimensionColor(const AISObjectPtr& theDimPrs) theDimPrs->setColor(aColor[0], aColor[1], aColor[2]); } -void replaceInName(ObjectPtr theObject, const std::string& theSource, const std::string& theDest) +void replaceInName(ObjectPtr theObject, const std::wstring& theSource, const std::wstring& theDest) { - std::string aName = theObject->data()->name(); + std::wstring aName = theObject->data()->name(); size_t aPos = aName.find(theSource); - if (aPos != std::string::npos) { - std::string aNewName = aName.substr(0, aPos) + theDest - + aName.substr(aPos + theSource.size()); + if (aPos != std::wstring::npos) { + std::wstring aNewName = aName.substr(0, aPos) + theDest + + aName.substr(aPos + theSource.size()); theObject->data()->setName(aNewName); } }