[Libreoffice-commits] core.git: 3 commits - sc/source
Eike Rathke
erack at redhat.com
Fri May 20 10:14:46 UTC 2016
sc/source/core/tool/interpr1.cxx | 8 ++++++++
sc/source/core/tool/interpr4.cxx | 8 ++++++++
sc/source/core/tool/interpr5.cxx | 33 +++++++++++++++++++++++----------
3 files changed, 39 insertions(+), 10 deletions(-)
New commits:
commit 824cf015683383b553c744a746ac8e8ea65495cf
Author: Eike Rathke <erack at redhat.com>
Date: Fri May 20 12:06:34 2016 +0200
tdf#93101 handle svExternalSingleRef in ISERROR()
Change-Id: I9e2a4aeb16d6777153d2f47a1c1af68fe2e97780
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9ee004d..fcbb2d0 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2771,6 +2771,14 @@ void ScInterpreter::ScIsError()
}
}
break;
+ case svExternalSingleRef:
+ {
+ ScExternalRefCache::TokenRef pToken;
+ PopExternalSingleRef(pToken);
+ if (nGlobalError || !pToken || pToken->GetType() == svError)
+ bRes = true;
+ }
+ break;
default:
PopError();
if ( nGlobalError )
commit 2f94ff566f7827792175daedb92f12a7e61ad95d
Author: Eike Rathke <erack at redhat.com>
Date: Fri May 20 12:02:58 2016 +0200
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
diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx
index 66b20f6..e1ff66e 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;
commit 7de92ad48d8c4fe7a1f9fb24ef8afc7d8907788e
Author: Eike Rathke <erack at redhat.com>
Date: Fri May 20 11:51:33 2016 +0200
tdf#93101 propagate external reference error from refcache token
Change-Id: I90491a7b18fddaddb3bbb4d7a3f8b9555b9b1198
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index e6985dc..fb17217 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1200,6 +1200,9 @@ void ScInterpreter::PopExternalSingleRef(
return;
}
+ if (xNew->GetType() == svError)
+ SetError( xNew->GetError());
+
rToken = xNew;
if (pFmt)
*pFmt = aFmt;
@@ -1298,6 +1301,11 @@ void ScInterpreter::GetExternalDoubleRef(
}
formula::FormulaToken* pToken = pArray->First();
+ if (pToken->GetType() == svError)
+ {
+ SetError( pToken->GetError());
+ return;
+ }
if (pToken->GetType() != svMatrix)
{
SetError(errIllegalArgument);
More information about the Libreoffice-commits
mailing list