diff options
author | Eike Rathke <erack@redhat.com> | 2013-10-16 23:22:10 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-10-16 23:29:29 +0200 |
commit | 5191cd8307fd7155fca5281b762d73e923c60c58 (patch) | |
tree | 4e881db49cf6e1002f525dc52ef80c6772710168 /sc | |
parent | 82a3c3f702e78232ebd4671c0061aa817bbd146b (diff) |
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
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
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; |