--- file_not_specified_in_diff +++ file_not_specified_in_diff @@ -, +, @@ --- main/sc/source/ui/unoobj/chart2uno.cxx +++ main/sc/source/ui/unoobj/chart2uno.cxx @@ -3035,31 +3035,32 @@ uno::Sequence< double > SAL_CALL ScChart2DataSequence::getNumericalData() } else { - sal_Int32 nMax = 0, nMin = 0, nMaxStep = 0, nMinStep = 0; + double fMax = 0, fMin = 0; + int nMaxStep = -1, nMinStep = -1; for (sal_Int32 j = 0; j < nStep; j++) { - sal_Int32 nValue = itr->mbIsValue ? itr->mfValue : fNAN; - if (nValue > nMax) + const double fValue = itr->mbIsValue ? itr->mfValue : fNAN; + if( (fMax < fValue) || (nMaxStep < 0)) { - nMax = nValue; + fMax = fValue; nMaxStep = j; } - if (nValue < nMin) + if( (fMin > fValue) || (nMinStep < 0)) { - nMin = nValue; + fMin = fValue; nMinStep = j; } itr++; } if (nMaxStep > nMinStep) { - *pArr++ = nMin; - *pArr++ = nMax; + *(pArr++) = fMin; + *(pArr++) = fMax; } else { - *pArr++ = nMax; - *pArr++ = nMin; + *(pArr++) = fMax; + *(pArr++) = fMin; } } }