From 444d3e017e42e3469056f0b4318ed66458d9bf17 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 1 May 2003 11:08:22 +0000 Subject: [PATCH] read numbers even if they're followed by spaces git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fileconf.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index fb05de0a4c..36537f99cf 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -865,12 +865,14 @@ bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const { - wxString str; - if ( !Read(key, & str) ) - { - return FALSE; - } - return str.ToLong(pl) ; + wxString str; + if ( !Read(key, &str) ) + return FALSE; + + // extra spaces shouldn't prevent us from reading numeric values + str.Trim(); + + return str.ToLong(pl); } bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) -- 2.45.2