| commit | bdd0cd702f37ff979b55a955905f9beb28f82ba1 | [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:49:10 2023 +0200 |
| tree | 9d3aae311f74fd5aaf020e5a8844ff40fb890065 | |
| parent | 0f976c3b5608ec77dc3ad539e9a8d83b2e423a60 [diff] |
Resolves: tdf#146068 don't crash when MA(central) lacks data Change-Id: I2c9b78f4d1a963bb71abb21068e61e6983ade777 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150501 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;