fixed 'patch' #422993 (Error in wxConfigBase::Write for doubles)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-05-27 02:23:16 +00:00
parent e3d0aa773d
commit 0da25f69ba

View File

@@ -134,8 +134,7 @@ bool wxConfigBase::Read(const wxString& key, double* val) const
wxString str;
if (Read(key, & str))
{
*val = wxAtof(str);
return TRUE;
return wxSscanf(str, _T("%g"), val) == 1;
}
return FALSE;
@@ -190,14 +189,15 @@ bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
{
long l;
bool ret = Read(key, &l, (long) defVal);
*pi = (int) l;
if (ret)
*pi = (int) l;
return ret;
}
bool wxConfigBase::Write(const wxString& key, double val)
{
wxString str;
str.Printf(wxT("%f"), val);
str.Printf(wxT("%g"), val);
return Write(key, str);
}
@@ -209,8 +209,7 @@ bool wxConfigBase::Write(const wxString& key, bool value)
bool wxConfigBase::Write( const wxString &key, const wxChar *text )
{
wxString str( text ) ;
return Write( key, str ) ;
return Write(key, str) ;
}
wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
{