[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Wed Oct 16 14:29:52 PDT 2013


 sc/source/core/tool/interpr1.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 5191cd8307fd7155fca5281b762d73e923c60c58
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Oct 16 23:22:10 2013 +0200

    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

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index d1e53df..56087c8 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;


More information about the Libreoffice-commits mailing list