X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1341230e80db9f532df40e28e8cb799136c4883d..4f55a07f9f4c6ba6905aaa8e584e6fb14771d278:/src/common/config.cpp?ds=sidebyside diff --git a/src/common/config.cpp b/src/common/config.cpp index da8e5b0901..1b614016b2 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -132,9 +132,9 @@ bool wxConfigBase::Read(const wxString& key, long *pl, long defVal) const bool wxConfigBase::Read(const wxString& key, double* val) const { wxString str; - if (Read(key, & str)) + if ( Read(key, &str) ) { - return wxSscanf(str, _T("%g"), val) == 1; + return str.ToDouble(val); } return FALSE; @@ -203,13 +203,13 @@ bool wxConfigBase::Write(const wxString& key, double val) bool wxConfigBase::Write(const wxString& key, bool value) { - long l = (value ? 1 : 0); - return Write(key, l); + return Write(key, value ? 1l : 0l); } -bool wxConfigBase::Write(const wxString &key, const wxChar *text) +bool wxConfigBase::Write(const wxString& key, const wxChar *value) { - return Write(key, text); + // explicit cast needed, otherwise value would have been converted to bool + return Write(key, wxString(value)); } wxString wxConfigBase::ExpandEnvVars(const wxString& str) const