diff --git a/include/wx/confbase.h b/include/wx/confbase.h index 584d4de71c..4b06078b0e 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -188,7 +188,11 @@ public: virtual bool Write(const wxString& key, double value); virtual bool Write(const wxString& key, bool value); - // permanently writes all changes + // we have to provide a separate version for C strings as otherwise they + // would be converted to bool and not to wxString as expected! + virtual bool Write(const wxString& key, const wxChar *value); + + // permanently writes all changes virtual bool Flush(bool bCurrentOnly = FALSE) = 0; // renaming, all functions return FALSE on failure (probably because the new diff --git a/src/common/config.cpp b/src/common/config.cpp index 129c866e99..d2015ed568 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -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++