Index: kmymoney/mymoney/mymoneyreport.h =================================================================== --- kmymoney/mymoney/mymoneyreport.h +++ kmymoney/mymoney/mymoneyreport.h @@ -3,7 +3,7 @@ * Copyright 2006 Darren Gould * Copyright 2007-2010 Alvaro Soliverez * Copyright 2017-2018 Łukasz Wojniłowicz - * Copyright 2018 Michael Kiefer + * Copyright 2018 Michael Kiefer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Index: kmymoney/mymoney/mymoneyreport.cpp =================================================================== --- kmymoney/mymoney/mymoneyreport.cpp +++ kmymoney/mymoney/mymoneyreport.cpp @@ -3,7 +3,7 @@ * Copyright 2006 Darren Gould * Copyright 2007-2010 Alvaro Soliverez * Copyright 2017-2018 Łukasz Wojniłowicz - * Copyright 2018 Michael Kiefer + * Copyright 2018 Michael Kiefer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Index: kmymoney/mymoney/mymoneyreport_p.h =================================================================== --- kmymoney/mymoney/mymoneyreport_p.h +++ kmymoney/mymoney/mymoneyreport_p.h @@ -3,7 +3,7 @@ * Copyright 2006 Darren Gould * Copyright 2007-2010 Alvaro Soliverez * Copyright 2017-2018 Łukasz Wojniłowicz - * Copyright 2018 Michael Kiefer + * Copyright 2018 Michael Kiefer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Index: kmymoney/plugins/views/reports/core/kreportchartview.h =================================================================== --- kmymoney/plugins/views/reports/core/kreportchartview.h +++ kmymoney/plugins/views/reports/core/kreportchartview.h @@ -2,7 +2,7 @@ * Copyright 2005 Ace Jones * Copyright 2005-2018 Thomas Baumgart * Copyright 2017-2018 Łukasz Wojniłowicz - * Copyright 2018 Michael Kiefer + * Copyright 2018 Michael Kiefer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as Index: kmymoney/plugins/views/reports/core/kreportchartview.cpp =================================================================== --- kmymoney/plugins/views/reports/core/kreportchartview.cpp +++ kmymoney/plugins/views/reports/core/kreportchartview.cpp @@ -294,9 +294,7 @@ PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { //determine whether expenses should be displayed as negative - bool invertValue = false; - if (config.isNegExpenses() && (*it_outergroup).m_inverted) - invertValue = true; + const bool invertValue = (config.isNegExpenses() && (*it_outergroup).m_inverted); // iterate over inner groups PivotOuterGroup::const_iterator it_innergroup = (*it_outergroup).begin(); while (it_innergroup != (*it_outergroup).end()) { @@ -355,9 +353,7 @@ PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { //determine whether expenses should be displayed as negative - bool invertValue = false; - if (config.isNegExpenses() && (*it_outergroup).m_inverted) - invertValue = true; + const bool invertValue = (config.isNegExpenses() && (*it_outergroup).m_inverted); // iterate over inner groups PivotOuterGroup::const_iterator it_innergroup = (*it_outergroup).begin(); while (it_innergroup != (*it_outergroup).end()) { @@ -392,9 +388,7 @@ PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { //determine whether expenses should be displayed as negative - bool invertValue = false; - if (config.isNegExpenses() && (*it_outergroup).m_inverted) - invertValue = true; + const bool invertValue = (config.isNegExpenses() && (*it_outergroup).m_inverted); // iterate row types for (int i = 0 ; i < myRowTypeListSize; ++i) { QString legendText; @@ -683,11 +677,9 @@ for (int i = startColumn; i < startColumn + columnsToDraw; ++i) { QStandardItem* item = new QStandardItem(); if (!m_skipZero || !gridRow.at(i).isZero()) { - double value; + double value = gridRow.at(i).toDouble(); if (invertValue) - value = - gridRow.at(i).toDouble(); - else - value = gridRow.at(i).toDouble(); + value = -value; item->setData(QVariant(value), Qt::DisplayRole); if (isToolTip) item->setToolTip(toolTip.arg(legendText).arg(value, 0, 'f', precision)); Index: kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.h =================================================================== --- kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.h +++ kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.h @@ -11,7 +11,7 @@ Kevin Tambascio Ace Jones (C) 2017, 2018 by Łukasz Wojniłowicz - 2018 by Michael Kiefer + 2018 by Michael Kiefer ***************************************************************************/ /*************************************************************************** Index: kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.cpp =================================================================== --- kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.cpp +++ kmymoney/plugins/views/reports/kreportconfigurationfilterdlg.cpp @@ -11,7 +11,7 @@ Kevin Tambascio Ace Jones (C) 2017, 2018 by Łukasz Wojniłowicz - 2018 by Michael Kiefer + 2018 by Michael Kiefer ***************************************************************************/ /*************************************************************************** @@ -394,10 +394,7 @@ void KReportConfigurationFilterDlg::slotNegExpensesChanged(int state) { Q_D(KReportConfigurationFilterDlg); - if (state == Qt::Checked) - d->m_tabChart->setNegExpenses(true); - else - d->m_tabChart->setNegExpenses(false); + d->m_tabChart->setNegExpenses(state == Qt::Checked); } void KReportConfigurationFilterDlg::slotReset() Index: kmymoney/plugins/views/reports/kreportsview_p.h =================================================================== --- kmymoney/plugins/views/reports/kreportsview_p.h +++ kmymoney/plugins/views/reports/kreportsview_p.h @@ -11,7 +11,7 @@ Kevin Tambascio Ace Jones (C) 2017 Łukasz Wojniłowicz - 2018 Michael Kiefer + 2018 Michael Kiefer ***************************************************************************/ /*************************************************************************** Index: kmymoney/plugins/views/reports/reporttabimpl.h =================================================================== --- kmymoney/plugins/views/reports/reporttabimpl.h +++ kmymoney/plugins/views/reports/reporttabimpl.h @@ -1,7 +1,7 @@ /* This file is part of the KDE project Copyright (C) 2009 Laurent Montel (C) 2017 by Łukasz Wojniłowicz - 2018 by Michael Kiefer + 2018 by Michael Kiefer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public Index: kmymoney/plugins/views/reports/reporttabimpl.cpp =================================================================== --- kmymoney/plugins/views/reports/reporttabimpl.cpp +++ kmymoney/plugins/views/reports/reporttabimpl.cpp @@ -1,7 +1,7 @@ /* This file is part of the KDE project Copyright (C) 2009 Laurent Montel (C) 2017 by Łukasz Wojniłowicz - Copyright 2018 Michael Kiefer + Copyright 2018 Michael Kiefer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -130,7 +130,7 @@ void ReportTabChart::setNegExpenses(bool set) { - // logarithm on negative numbers does not make sense, so hide it + // logarithm on negative numbers does not make sense, so disable it if (set) { ui->m_logYaxis->setChecked(false); ui->m_logYaxis->setEnabled(false); Index: kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp =================================================================== --- kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp +++ kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp @@ -3,7 +3,7 @@ * Copyright 2006 Darren Gould * Copyright 2007-2010 Alvaro Soliverez * Copyright 2017-2018 Łukasz Wojniłowicz - * Copyright 2018 Michael Kiefer + * Copyright 2018 Michael Kiefer * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -694,7 +694,7 @@ report.setChartDataLabels(node.attribute(attributeName(Attribute::Report::ChartDataLabels), "1").toUInt()); report.setChartByDefault(node.attribute(attributeName(Attribute::Report::ChartByDefault), "0").toUInt()); report.setLogYAxis(node.attribute(attributeName(Attribute::Report::LogYAxis), "0").toUInt()); - report.setNegExpenses(node.attribute(attributeName(Attribute::Report::NegExpenses), "1").toUInt()); + report.setNegExpenses(node.attribute(attributeName(Attribute::Report::NegExpenses), "0").toUInt()); report.setChartLineWidth(node.attribute(attributeName(Attribute::Report::ChartLineWidth), QString(MyMoneyReport::m_lineWidth)).toUInt()); // read range tab