From 5191cd8307fd7155fca5281b762d73e923c60c58 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 16 Oct 2013 23:22:10 +0200 Subject: fixed MIN and MAX matrix case regression Introduced with 58380c11216cb9f03a98e3d53dcee702576fedb8 If in MIN matrix minimum was >0.0 the result was always 0. If in MAX matrix maximum was <0.0 the result was always 0. Change-Id: I59bd1e9815912eae6b4846c092d98a8949b30e8d --- sc/source/core/tool/interpr1.cxx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sc') diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index d1e53df8704e..56087c87dd6e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3657,7 +3657,11 @@ void ScInterpreter::ScMin( bool bTextAsZero ) { ScMatrixRef pMat = GetMatrix(); if (pMat) - nMin = pMat->GetMinValue(bTextAsZero); + { + nVal = pMat->GetMinValue(bTextAsZero); + if (nMin > nVal) + nMin = nVal; + } } break; case svString : @@ -3750,7 +3754,9 @@ void ScInterpreter::ScMax( bool bTextAsZero ) if (pMat) { nFuncFmtType = NUMBERFORMAT_NUMBER; - nMax = pMat->GetMaxValue(bTextAsZero); + nVal = pMat->GetMaxValue(bTextAsZero); + if (nMax < nVal) + nMax = nVal; } } break; -- cgit