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;
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