From: <ste...@us...> - 2012-05-07 13:43:53
|
Revision: 2261 http://moneymanagerex.svn.sourceforge.net/moneymanagerex/?rev=2261&view=rev Author: stef145g Date: 2012-05-07 13:43:43 +0000 (Mon, 07 May 2012) Log Message: ----------- Fix: 2nd attempt - stop debug warning trying to replace an empty with an empty string Modified Paths: -------------- trunk/mmex/src/util.cpp Modified: trunk/mmex/src/util.cpp =================================================================== --- trunk/mmex/src/util.cpp 2012-05-07 02:48:29 UTC (rev 2260) +++ trunk/mmex/src/util.cpp 2012-05-07 13:43:43 UTC (rev 2261) @@ -853,19 +853,17 @@ bool mmex::formatCurrencyToDouble(const wxString& str, double& val) { - // Correct Empty String conversion test from wxChar to wxString. - wxString emptyCharStr = wxEmptyString; - val = 0; const CurrencyFormatter &fmt = CurrencyFormatter::instance(); wxString s = str; + // remove separators from the amount. wxString gs = fmt.getGroupSeparator(); - if (gs != emptyCharStr) s.Replace(gs, wxEmptyString); + if (s.Find(gs)) s.Replace(gs, wxEmptyString); // adjust decimal point char to a decimal point. wxString gdp = fmt.getDecimalPoint(); - if (gdp != emptyCharStr) s.Replace(gdp, wxT(".")); + if (s.Find(gdp)) s.Replace(gdp, wxT(".")); return !s.empty() && s.ToDouble(&val); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |