summaryrefslogtreecommitdiff
path: root/chart2/source/view
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2015-06-17 15:15:07 +0200
committerJan Holesovsky <kendy@collabora.com>2015-08-13 09:50:01 +0000
commitb3abc191e24bd2e812836257024d14557a6238ce (patch)
treee7a750f0bc70d8e07ea7ec54a68f574fad2f0155 /chart2/source/view
parentbb1cc8361d13461d8bcb9a9a4a8c1b9c1721c991 (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: I229f4c8f8fda54684e1c817ea7da06fd87eb79b9 Reviewed-on: https://gerrit.libreoffice.org/17343 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'chart2/source/view')
-rw-r--r--chart2/source/view/main/VDataSeries.cxx8
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)