From 5341ca4e22ed03ae8d8f1f42887597679471b393 Mon Sep 17 00:00:00 2001 From: capostrophic Date: Thu, 1 Aug 2019 11:40:53 +0300 Subject: [PATCH] [Regression] Avoid locale-related conversion issues in editor --- apps/opencs/model/prefs/state.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/opencs/model/prefs/state.cpp b/apps/opencs/model/prefs/state.cpp index a206fad6f..bfe907c19 100644 --- a/apps/opencs/model/prefs/state.cpp +++ b/apps/opencs/model/prefs/state.cpp @@ -3,6 +3,7 @@ #include #include +#include #include "intsetting.hpp" #include "doublesetting.hpp" @@ -415,7 +416,9 @@ CSMPrefs::DoubleSetting& CSMPrefs::State::declareDouble (const std::string& key, if (mCurrentCategory==mCategories.end()) throw std::logic_error ("no category for setting"); - setDefault(key, std::to_string(default_)); + std::ostringstream stream; + stream << default_; + setDefault(key, stream.str()); default_ = mSettings.getFloat (key, mCurrentCategory->second.getKey());