diff --git a/ChangeLog b/ChangeLog index 6fbe3dd..5ba8c2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,11 @@ -v0.7 (11/11/2016) +v0.7 (01/01/2017) ** User ** - Set background calendar color to red or yellow when one account is negative or less than 200 + Set background calendar color to red or yellow when one account is negative or less than 200€ ** Dev ** ** Bugs ** + Bug in expression parser, negative mark before parenthesis considered as positive. + Bug in FormulaDelegate : string copy was made in a wrong way v0.6 (08/10/2016) ** User ** diff --git a/src/view/grid/FormulaDelegate.cpp b/src/view/grid/FormulaDelegate.cpp index 0e41356..8c17b0f 100644 --- a/src/view/grid/FormulaDelegate.cpp +++ b/src/view/grid/FormulaDelegate.cpp @@ -23,6 +23,7 @@ #include "FormulaDelegate.hpp" #include #include "../wxUI.hpp" +#include #include QWidget * FormulaDelegate::createEditor (QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const @@ -38,17 +39,17 @@ void FormulaDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, double res = 0.0; QString value = line->text(); struct ParseExp::parse_opt opt, *r; - const char* c; char* str, *str2; bool ok; - + std::string ss; + value = value.trimmed(); if (value.startsWith("=")) { value = value.replace(",", "."); - c = value.toStdString().c_str(); - str2 = str = new char[strlen(c)]; - strcpy(str, c+1); + ss = value.toStdString(); + str2 = str = new char[ss.length()]; + std::strcpy(str, ss.c_str()+1); memset(&opt, 0, sizeof(opt)); r = &opt; try {