| commit | fde5e93fb09d079cbd145a08469e56339f58c4f9 | [log] |
|---|---|---|
| author | Caolán McNamara <caolanm@redhat.com> | Mon Apr 17 09:38:45 2023 +0100 |
| committer | Michael Stahl <michael.stahl@allotropia.de> | Tue Apr 18 11:48:57 2023 +0200 |
| tree | b2697c55599b1eaf2f170e29dab9eab0894483c1 | |
| parent | 756e7701486318e72dce823f3946b7b2ea350132 [diff] |
Resolves: tdf#146068 don't crash when MA(central) lacks data Change-Id: I2c9b78f4d1a963bb71abb21068e61e6983ade777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150500 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx index 6236f73..6726d9d 100644 --- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx +++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
@@ -84,6 +84,8 @@ void MovingAverageRegressionCurveCalculator::calculateValuesCentral( RegressionCalculationHelper::tDoubleVectorPair aValues) { const size_t aSize = aValues.first.size(); if (aSize == 0) return; for (size_t i = mPeriod - 1; i < aSize; ++i) { double yAvg = 0.0;