From: nds Date: Fri, 15 Apr 2016 11:33:55 +0000 (+0300) Subject: Skip spaces in XML row X-Git-Tag: V_2.3.0~215 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bc35c2916abdb343a5ce20ee2251ddfb687faf5d;p=modules%2Fshaper.git Skip spaces in XML row --- diff --git a/src/Config/Config_Common.cpp b/src/Config/Config_Common.cpp index bb5ddeed9..ce096355a 100644 --- a/src/Config/Config_Common.cpp +++ b/src/Config/Config_Common.cpp @@ -220,6 +220,8 @@ std::string library(const std::string& theLibName) return aLibName; } +bool BothAreSpaces(char lhs, char rhs) { return (lhs == rhs) && (lhs == ' '); } + std::string getProperty(xmlNodePtr theNode, const char* thePropName) { std::string result = ""; @@ -227,6 +229,10 @@ std::string getProperty(xmlNodePtr theNode, const char* thePropName) if (!aPropChars || aPropChars[0] == 0) return result; result = std::string(aPropChars); + + std::string::iterator new_end = std::unique(result.begin(), result.end(), BothAreSpaces); + result.erase(new_end, result.end()); + return result; }