diff options
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index dd1aaca90d53..33cd8c3f840e 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -713,10 +713,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 ); |