chart2/source/view/main/VDataSeries.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit a45cad345e917f6d43c26e4c682c6066c8e2b88a Author: Laurent Balland-Poirier <[email protected]> Date: Wed Jun 17 15:15:07 2015 +0200 tdf#76649 Skip NaN initial values for min and max min and max were initiated as aValuesX[0] which could be NaN test i before evaluating aValuesX[i] Change-Id: I0246913dcf427e59fd354321eeffa7c08c41c08d Reviewed-on: https://gerrit.libreoffice.org/17772 Tested-by: Jenkins <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 043cbaa..18614b1 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -520,9 +520,13 @@ void VDataSeries::getMinMaxXValue(double& fMin, double& fMax) const if(aValuesX.getLength() > 0) { - fMax = fMin = aValuesX[0]; + sal_Int32 i = 0; + while ( i < aValuesX.getLength() && ::rtl::math::isNan( aValuesX[i] ) ) + i++; + if ( i < aValuesX.getLength() ) + fMax = fMin = aValuesX[i++]; - for (sal_Int32 i = 1; i < aValuesX.getLength(); i++) + for ( ; i < aValuesX.getLength(); i++) { const double aValue = aValuesX[i]; if ( aValue > fMax)
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
