Kaydet (Commit) b3abc191 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Jan Holesovsky

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/17343Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
Tested-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst bb1cc836
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment