summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-06-14 11:41:40 +0200
committerEike Rathke <erack@redhat.com>2017-06-14 11:42:13 +0200
commit90bea1ea24838845646ec253d1a4b472b73d53ca (patch)
tree614e55a89724e135122f237a225a552ae6683d79
parent3919d87210ea12ed3166c649ac52730026db01a4 (diff)
Final result of Reference array is svMatrix instead of svRefList, tdf#58874
So {=OFFSET(A1,{1;2;3},0)} or {=OFFSET(A1,B1:B3,0)} return a column vector and {=OFFSET(A1,{1,2,3},0)} or {=OFFSET(A1,B1:D1,0)} return a row vector like they did before. Excel doesn't handle this at all and returns #VALUE! instead. Change-Id: Iba14ba4ca089568ddc724a22d3093bfe6b73b995
-rw-r--r--sc/source/core/tool/interpr1.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 547dd0a98db3..c9fa796a551f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -799,9 +799,11 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
}
}
if ( !bCont )
- { // we're done with it, throw away jump matrix, keep result
+ { // We're done with it, throw away jump matrix, keep result.
+ // For an intermediate result of Reference use the array of references,
+ // else (also for a final result of Reference) use the matrix.
formula::ParamClass eReturnType = ScParameterClassification::GetParameterType( pCur, SAL_MAX_UINT16);
- if (eReturnType == ParamClass::Reference)
+ if (eReturnType == ParamClass::Reference && aCode.PeekNextOperator())
{
FormulaTokenRef xRef = new ScRefListToken(true);
*(xRef->GetRefList()) = pJumpMatrix->GetRefList();