diff options
-rw-r--r-- | sw/source/core/bastyp/calc.cxx | 18 |
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; |