diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2015-06-17 15:15:07 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2015-07-24 16:17:47 +0000 |
commit | ae5ff039f697016a9c04b8f99c24f4e620ce4c65 (patch) | |
tree | 9264140ec79bb4cc23f4b9f431800661576e0a89 /chart2 | |
parent | da24bd36a5213670b5636abf4dbac317c4135c07 (diff) |
tdf#76649 Skip NaN initial values for min and max
min and max were initiated as aValuesX[0] which could be NaN
Change-Id: I0246913dcf427e59fd354321eeffa7c08c41c08d
Reviewed-on: https://gerrit.libreoffice.org/16345
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/main/VDataSeries.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 3efa477734ca..6667cbbefca3 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 ( ::rtl::math::isNan( aValuesX[i] ) && i < aValuesX.getLength() ) + 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) |