mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-06 21:55:43 +01:00
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.
This commit is contained in:
parent
0656d5ab1a
commit
e7a23eaaa8
2 changed files with 35 additions and 10 deletions
|
|
@ -83,6 +83,9 @@ private:
|
|||
ArdourCanvas::HSV color_hsv (const std::string&) const;
|
||||
ArdourCanvas::SVAModifier modifier (const std::string&) const;
|
||||
|
||||
static std::string color_to_hex_string (ArdourCanvas::Color c);
|
||||
static std::string color_to_hex_string_no_alpha (ArdourCanvas::Color c);
|
||||
|
||||
sigc::signal<void> ColorsChanged;
|
||||
|
||||
void reset_dpi ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue