diff options
author | Eike Rathke <erack@redhat.com> | 2012-06-27 16:29:02 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-06-27 16:54:42 +0200 |
commit | b709845e27db0f439c430c9ebe3c2884dbc48789 (patch) | |
tree | beba71427c66ff9841d4997982bfa0fca6a38fc4 /sc | |
parent | 72b4cb18a402338dd65d24d9da8da7fe0fa33db0 (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
Diffstat (limited to 'sc')
-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 a7f6572bc9fc..2508b256b7e4 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 : |