X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_PropManager.cpp;h=17ad00b5377db2cca95dc8b1cb81b9961af763e5;hb=aa941d4038c5880146ea98adc84e5d02fc729c49;hp=e754039e3a01436c45455057987d3431a17fa962;hpb=9b61e5ee5eafe9d6948d9a78667efa2abec132c3;p=modules%2Fshaper.git diff --git a/src/Config/Config_PropManager.cpp b/src/Config/Config_PropManager.cpp index e754039e3..17ad00b53 100644 --- a/src/Config/Config_PropManager.cpp +++ b/src/Config/Config_PropManager.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 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 @@ -12,14 +12,15 @@ // // 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 +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "Config_PropManager.h" +bool Config_PropManager::autoColorStatus = false; + std::vector stringToRGB(const std::string& theColor); int stringToInteger(const std::string& theInt); bool stringToBoolean(const std::string& theInt); @@ -29,6 +30,15 @@ Config_Properties& Config_PropManager::props() { return *confProps; } +bool Config_PropManager::getAutoColorStatus() +{ + return Config_PropManager::autoColorStatus; +} + +void Config_PropManager::setAutoColorStatus(const bool theValue) +{ + Config_PropManager::autoColorStatus = theValue; +} Config_Prop* Config_PropManager::registerProp(const std::string& theSection, const std::string& theName, @@ -51,8 +61,10 @@ Config_Prop* Config_PropManager::registerProp(const std::string& theSection, aProp->setType(theType); aProp->setTitle(theTitle); } - aProp->setMin(theMin); - aProp->setMax(theMax); + if (theMin != "") + aProp->setMin(theMin); + if (theMax != "") + aProp->setMax(theMax); } else { aProp = @@ -208,7 +220,7 @@ double Config_PropManager::stringToDouble(const std::string& theDouble) // change locale and convert "," to "." if exists std::string aCurLocale = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, "C"); - int dotpos = (int)aStr.find(','); + size_t dotpos = aStr.find(','); if (dotpos != std::string::npos) aStr.replace(dotpos, 1, ".");