summaryrefslogtreecommitdiff
path: root/libs/canvas
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-08-20 23:20:57 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:36:55 +1000
commit7085d7305dd97a182697972bdcaeefe07cf1023f (patch)
treedee144bdc8f14695d3505c351a4fc2f3c6791e86 /libs/canvas
parent9488cb0b69d5aab173a3eecd63453558a7abce51 (diff)
Use locale independent string conversion functions in SVAModifier class
Diffstat (limited to 'libs/canvas')
-rw-r--r--libs/canvas/colors.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/libs/canvas/colors.cc b/libs/canvas/colors.cc
index 0bd3f8b049..f03baa52fd 100644
--- a/libs/canvas/colors.cc
+++ b/libs/canvas/colors.cc
@@ -22,9 +22,9 @@
#include <stdint.h>
#include <cfloat>
-#include "pbd/convert.h"
#include "pbd/failed_constructor.h"
#include "pbd/locale_guard.h"
+#include "pbd/string_convert.h"
#include "canvas/colors.h"
#include "canvas/colorspace.h"
@@ -261,10 +261,10 @@ HSV::to_string () const
{
PBD::LocaleGuard lg;
stringstream ss;
- ss << h << ' ';
- ss << s << ' ';
- ss << v << ' ';
- ss << a;
+ ss << PBD::to_string(h) << ' ';
+ ss << PBD::to_string(s) << ' ';
+ ss << PBD::to_string(v) << ' ';
+ ss << PBD::to_string(a);
return ss.str();
}
@@ -583,11 +583,11 @@ SVAModifier::from_string (string const & str)
while (ss) {
ss >> mod;
if ((pos = mod.find ("alpha:")) != string::npos) {
- _a = PBD::atof (mod.substr (pos+6));
+ _a = PBD::string_to<double>(mod.substr (pos+6));
} else if ((pos = mod.find ("saturate:")) != string::npos) {
- _s = PBD::atof (mod.substr (pos+9));
+ _s = PBD::string_to<double>(mod.substr (pos+9));
} else if ((pos = mod.find ("darkness:")) != string::npos) {
- _v = PBD::atof (mod.substr (pos+9));
+ _v = PBD::string_to<double>(mod.substr (pos+9));
} else {
throw failed_constructor ();
}
@@ -613,15 +613,15 @@ SVAModifier::to_string () const
}
if (_s >= 0.0) {
- ss << " saturate:" << _s;
+ ss << " saturate:" << PBD::to_string(_s);
}
if (_v >= 0.0) {
- ss << " darker:" << _v;
+ ss << " darker:" << PBD::to_string(_v);
}
if (_a >= 0.0) {
- ss << " alpha:" << _a;
+ ss << " alpha:" << PBD::to_string(_a);
}
return ss.str();