diff options
author | Eike Rathke <erack@redhat.com> | 2012-06-27 16:29:02 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-07-02 11:25:32 +0200 |
commit | c8092e757780b38c97e1ad3bf6f76a132b6b63d2 (patch) | |
tree | df80865f7e58089861ac299fc524683b6abaf882 | |
parent | 6096e8990329d286a5e666643517ba4aa82d4161 (diff) |
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
(cherry picked from commit b709845e27db0f439c430c9ebe3c2884dbc48789)
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index fbb8b548dff0..58413af57148 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2984,20 +2984,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 : |