X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0da25f69ba98bcc60629d873820edacc17686e92..4f55a07f9f4c6ba6905aaa8e584e6fb14771d278:/src/common/config.cpp diff --git a/src/common/config.cpp b/src/common/config.cpp index 5ec9090807..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,14 +203,15 @@ 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, str) ; + // 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++