X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e1b8d4d841979b9fed749e1f8a18abc58975a4d9..803c55373484d1e2bfed85b46cbbfff8bfad1276:/src/common/config.cpp diff --git a/src/common/config.cpp b/src/common/config.cpp index 129c866e99..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; @@ -206,6 +206,12 @@ bool wxConfigBase::Write(const wxString& key, bool value) return Write(key, value ? 1l : 0l); } +bool wxConfigBase::Write(const wxString& key, const wxChar *value) +{ + // explicit cast needed, otherwise value would have been converted to bool + return Write(key, wxString(value)); +} + wxString wxConfigBase::ExpandEnvVars(const wxString& str) const { wxString tmp; // Required for BC++