From: Vadim Zeitlin Date: Sun, 27 May 2001 19:01:38 +0000 (+0000) Subject: really fixed wxConfig bug X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/68275b8532c786567659db548e905e5495509a4b really fixed wxConfig bug git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- 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++