summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2018-07-07 23:00:50 +0200
committerAndras Timar <andras.timar@collabora.com>2018-07-09 09:48:22 +0200
commit4655a28e386f754ca6b355344d35a0ef759d21ca (patch)
tree938b1b1394abbdd98f37c1f47ca259e06773fa0c
parent5aa6450109805a317d3841bad722ed000e0d321d (diff)
Resolves: tdf#118561 handle external references as jump matrix result
Change-Id: I0381179347960293f5d470ed231d626cb6707b5a Reviewed-on: https://gerrit.libreoffice.org/57144 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins (cherry picked from commit a5b9bb7be70c7aec2388199e68a0cf86dd220955) Reviewed-on: https://gerrit.libreoffice.org/57148 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 8f3515b5e54dabb08ddb01253d9503e9c16cfebe)
-rw-r--r--sc/source/core/tool/interpr1.cxx36
1 files changed, 35 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 49c7d009f05a..cb0ac61a3cc6 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -714,10 +714,44 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
}
}
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (nGlobalError != FormulaError::NONE)
+ {
+ pJumpMatrix->PutResultDouble( CreateDoubleError( nGlobalError), nC, nR );
+ nGlobalError = FormulaError::NONE;
+ }
+ else
+ {
+ switch (pToken->GetType())
+ {
+ case svDouble:
+ pJumpMatrix->PutResultDouble( pToken->GetDouble(), nC, nR );
+ break;
+ case svString:
+ pJumpMatrix->PutResultString( pToken->GetString(), nC, nR );
+ break;
+ case svEmptyCell:
+ pJumpMatrix->PutResultEmpty( nC, nR );
+ break;
+ default:
+ // svError was already handled (set by
+ // PopExternalSingleRef()) with nGlobalError
+ // above.
+ assert(!"unhandled svExternalSingleRef case");
+ pJumpMatrix->PutResultDouble( CreateDoubleError(
+ FormulaError::UnknownStackVariable), nC, nR );
+ }
+ }
+ }
+ break;
+ case svExternalDoubleRef:
case svMatrix:
{ // match matrix offsets
double fVal;
- ScMatrixRef pMat = PopMatrix();
+ ScMatrixRef pMat = GetMatrix();
if ( nGlobalError != FormulaError::NONE )
{
fVal = CreateDoubleError( nGlobalError );