[Libreoffice-commits] core.git: Branch 'libreoffice-5-2-2' - sc/source

Eike Rathke erack at redhat.com
Wed Sep 21 09:34:14 UTC 2016


 sc/source/core/tool/interpr4.cxx |   26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit 432595ba7e646bd91dcc2743aee8ff791c391748
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Sep 19 18:04:54 2016 +0200

    Resolves: tdf#102215 do not return coded double error for single matrix value
    
    Change-Id: I94477bf64ee7972e9822921a8a15d935cb01e53b
    (cherry picked from commit 388014fc19b2a785f887cdfee91100fc9ab8d58d)
    Reviewed-on: https://gerrit.libreoffice.org/29036
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index e4b3e5e..24a3d53 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1964,14 +1964,36 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat)
         return 0.0;
 
     if ( !pJumpMatrix )
-        return pMat->GetDoubleWithStringConversion( 0, 0);
+    {
+        double fVal = pMat->GetDoubleWithStringConversion( 0, 0);
+        sal_uInt16 nErr = GetDoubleErrorValue( fVal);
+        if (nErr)
+        {
+            // Do not propagate the coded double error, but set nGlobalError in
+            // case the matrix did not have an error interpreter set.
+            SetError( nErr);
+            fVal = 0.0;
+        }
+        return fVal;
+    }
 
     SCSIZE nCols, nRows, nC, nR;
     pMat->GetDimensions( nCols, nRows);
     pJumpMatrix->GetPos( nC, nR);
     // Use vector replication for single row/column arrays.
     if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) )
-        return pMat->GetDoubleWithStringConversion( nC, nR);
+    {
+        double fVal = pMat->GetDoubleWithStringConversion( nC, nR);
+        sal_uInt16 nErr = GetDoubleErrorValue( fVal);
+        if (nErr)
+        {
+            // Do not propagate the coded double error, but set nGlobalError in
+            // case the matrix did not have an error interpreter set.
+            SetError( nErr);
+            fVal = 0.0;
+        }
+        return fVal;
+    }
 
     SetError( errNoValue);
     return 0.0;


More information about the Libreoffice-commits mailing list