summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2015-11-25 13:15:13 +1000
committerMike Kaganski <mikekaganski@hotmail.com>2015-11-25 04:03:50 +0000
commita15b9b44d933ef06efbc231d66b79815ba69ceff (patch)
treef0dfa085f1d7124b719ce442c91770e4cf2e2a33
parent7289a140fc68dc898ba2b2357cc960968195f236 (diff)
tdf#61228: formatting and commenting
Change-Id: Ic5d1090722945dce338973e9e3091546ed792057 Reviewed-on: https://gerrit.libreoffice.org/20160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mikekaganski@hotmail.com>
-rw-r--r--sw/source/core/bastyp/calc.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 8b12d87e7bb4..7864657a54e0 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -1317,18 +1317,20 @@ SwSbxValue SwCalc::Prim()
break;
case CALC_NAME:
- switch(SwCalcOper nOper = GetToken())
+ switch(SwCalcOper eOper = GetToken())
{
case CALC_ASSIGN:
- {
- SwCalcExp* n = VarInsert(aVarName);
- GetToken();
- nErg = n->nValue = Expr();
- }
- break;
+ {
+ SwCalcExp* n = VarInsert(aVarName);
+ GetToken();
+ nErg = n->nValue = Expr();
+ }
+ break;
default:
nErg = VarLook(aVarName)->nValue;
- if (nErg.IsVoidValue() && (nOper == CALC_LP))
+ // Explicitly disallow unknown function names (followed by "("),
+ // allow unknown variable names (equal to zero)
+ if (nErg.IsVoidValue() && (eOper == CALC_LP))
eError = CALC_SYNTAX;
else
bChkPow = true;