Use snprintf instead of std::stringstream when converting color values to strings
authorTim Mayberry <mojofunk@gmail.com>
Tue, 6 Sep 2016 04:27:10 +0000 (14:27 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Tue, 18 Apr 2017 23:36:59 +0000 (09:36 +1000)
commite7a23eaaa81564568d17fd0af1bdeb20996a434f
tree28690276f77406e22699eb103e5ff2d220540038
parent0656d5ab1a44ceec3c3f0713b8c9fa1fbe9054f7
Use snprintf instead of std::stringstream when converting color values to strings

std::ostream/stringstream will use the current locale to determine the numeric
formatting. If the locale uses grouping then thousands separators will be
inserted in the output which produces an invalid color string in
UIConfiguration::reset_gtk_theme() and when converting colors to strings in
UIConfiguration::store_color_theme()

This has not been a problem so far because it appears that LocaleGuard does not
reset the LC_NUMERIC value for the global C++ locale. So if a LocaleGuard is
created at any time before these functions are called(even if it goes out of
scope) the numeric formatting used by std::streams will use the "C" locale
formatting facets.
gtk2_ardour/ui_config.cc
gtk2_ardour/ui_config.h