From eccaad3bef0a2f329081f361759e32fdf4813a32 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 19 Nov 2010 12:05:14 +0000 Subject: [PATCH] Fix from E.Adam to solve problem for studies with string notebook variables. --- src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx index e6bb38616..1bd9fb353 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_ScalarVariable.cxx @@ -122,7 +122,7 @@ std::string SALOMEDSImpl_ScalarVariable::Save() const{ } case SALOMEDSImpl_GenericVariable::STRING_VAR: { - sprintf(buffer, "\"%s\"", myStrValue.c_str()); + sprintf(buffer, "%s", myStrValue.c_str()); break; } default:break; @@ -187,11 +187,15 @@ void SALOMEDSImpl_ScalarVariable::Load(const std::string& theStrValue) { Kernel_Utils::Localizer loc; + std::string strCopy = theStrValue; if ( Type() == SALOMEDSImpl_GenericVariable::STRING_VAR ) { - setStringValue( theStrValue ); +#ifdef OLDSTUDY_COMPATIBILITY + if (strCopy.size() > 1 && strCopy[0] == '\"' && strCopy[strCopy.size()-1] == '\"') + strCopy = strCopy.substr(1, strCopy.size()-2); +#endif // OLDSTUDY_COMPATIBILITY + setStringValue( strCopy ); } else { - std::string strCopy = theStrValue; #ifdef OLDSTUDY_COMPATIBILITY int dotpos = strCopy.find(','); if (dotpos != std::string::npos) -- 2.39.2