diff options
author | Eike Rathke <erack@redhat.com> | 2016-05-20 12:02:58 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-20 12:14:20 +0200 |
commit | 2f94ff566f7827792175daedb92f12a7e61ad95d (patch) | |
tree | f74480faf2eeb09107a801354a3a9888da3831cb /sc | |
parent | 7de92ad48d8c4fe7a1f9fb24ef8afc7d8907788e (diff) |
tdf#93101 correctly resolve svExternalSingleRef token in GetMatrix()
... including error propagation, and use GetNewMat() instead of a plain
ScFullMatrix so the interpreter error handling is set up.
Change-Id: I862c46f9afc2afd0bb2a23aa767158e0945583a5
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr5.cxx | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 66b20f6cced5..e1ff66e2b642 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -455,25 +455,38 @@ ScMatrixRef ScInterpreter::GetMatrix() { ScExternalRefCache::TokenRef pToken; PopExternalSingleRef(pToken); - if (!pToken) + pMat = GetNewMat( 1, 1, true); + if (!pMat) { - PopError(); SetError( errIllegalArgument); break; } - if (pToken->GetType() == svDouble) + if (!pToken) { - pMat = new ScFullMatrix(1, 1, 0.0); - pMat->PutDouble(pToken->GetDouble(), 0, 0); + SetError( errIllegalArgument); + pMat->PutError( nGlobalError, 0, 0); + nGlobalError = 0; + break; } - else if (pToken->GetType() == svString) + if (nGlobalError) { - pMat = new ScFullMatrix(1, 1, 0.0); - pMat->PutString(pToken->GetString(), 0, 0); + pMat->PutError( nGlobalError, 0, 0); + nGlobalError = 0; + break; } - else + switch (pToken->GetType()) { - pMat = new ScFullMatrix(1, 1); + case svError: + pMat->PutError( pToken->GetError(), 0, 0); + break; + case svDouble: + pMat->PutDouble( pToken->GetDouble(), 0, 0); + break; + case svString: + pMat->PutString( pToken->GetString(), 0, 0); + break; + default: + ; // nothing, empty element matrix } } break; |