sc/source/core/tool/interpr1.cxx |   17 +++++++----------
 sc/source/core/tool/interpr4.cxx |    7 +++++++
 2 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit b709845e27db0f439c430c9ebe3c2884dbc48789
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jun 27 16:29:02 2012 +0200

    resolved fdo#51478 handle array context in T()
    
    Note that Excel for T() does not use position dependent range
    intersection (SingleRef of DoubleRef) when a range reference is passed
    and does not handle evaluation in array context (instead top left value
    is always used), which both is inconsistent with other functions taking
    a scalar value parameter. ODFF does not specify this function different.
    range intersection was already implemented, this change adds array
    evaluation. Gnumeric does the same.
    
    Change-Id: I4acae943fde247c6d60b55d0f8514fb17d401f40

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index a7f6572..2508b25 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3082,20 +3082,17 @@ void ScInterpreter::ScT()
             }
         }
         break;
+        case svMatrix:
         case svExternalSingleRef:
         case svExternalDoubleRef:
         {
-            ScMatrixRef pMat = GetMatrix();
-            if (!pMat || !pMat->GetElementCount())
-            {
-                SetError( errIllegalParameter);
-                break;
-            }
-
-            if (pMat->IsString(0, 0))
-                PushString(pMat->GetString(0, 0));
+            double fVal;
+            String aStr;
+            ScMatValType nMatValType = GetDoubleOrStringFromMatrix( fVal, 
aStr);
+            if (ScMatrix::IsValueType( nMatValType))
+                PushString( EMPTY_STRING);
             else
-                PushString(EMPTY_STRING);
+                PushString( aStr);
         }
         break;
         case svDouble :
commit 72b4cb18a402338dd65d24d9da8da7fe0fa33db0
Author: Eike Rathke <er...@redhat.com>
Date:   Wed Jun 27 16:15:05 2012 +0200

    propagate error in ScInterpreter::GetDoubleOrStringFromMatrix()
    
    Change-Id: Iadba0f3a28b0a3bda9b99833510e68679d915514

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 08d9acc..bca2977 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -2451,6 +2451,13 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( 
double& rDouble,
     else
         rString = nMatVal.GetString();
 
+    if (ScMatrix::IsValueType( nMatValType))
+    {
+        sal_uInt16 nError = nMatVal.GetError();
+        if (nError)
+            SetError( nError);
+    }
+
     return nMatValType;
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to