From 7cb84f9931aba48a58a300da58febb27619058c1 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 29 Feb 2016 14:17:49 +0200 Subject: [PATCH] Fixed broken formula when for system locale thousand separator is a space. --HG-- branch : release --- ChangeLog.txt | 1 + src/libs/vpatterndb/vtranslatevars.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index fe616e5ad..c2f26445b 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,4 +1,5 @@ # Version 0.4.3 +- Fixed broken formula when for system locale thousand separator is a space. - Using QGraphicsScene instead of VMainGraphicsScene caused a crash. - Fixed bug disabling tool True darts. - Fixed wrong calculation tool True darts. diff --git a/src/libs/vpatterndb/vtranslatevars.cpp b/src/libs/vpatterndb/vtranslatevars.cpp index ef8bf9a29..4d98d3388 100644 --- a/src/libs/vpatterndb/vtranslatevars.cpp +++ b/src/libs/vpatterndb/vtranslatevars.cpp @@ -889,7 +889,8 @@ QString VTranslateVars::FormulaToUser(const QString &formula) const } loc = QLocale::system();// To user locale - const QString dStr = loc.toString(d);// Number string in user locale + QString dStr = loc.toString(d);// Number string in user locale + dStr.replace(" ", ""); // Remove thousand separator newFormula.replace(nKeys.at(i), nValues.at(i).length(), dStr); const int bias = nValues.at(i).length() - dStr.length(); if (bias != 0)