sw/source/core/bastyp/calc.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
New commits: commit d667e3210b12c7ce3b3727e2a0e369a520fbaaa4 Author: Julien Nabet <serval2...@yahoo.fr> Date: Sun Nov 22 17:42:08 2015 +0100 tdf#61228: Wrong function names in Formula Writer are considered as SUM Unknown names make the formula fail PythonTest_sw_python, especially set_expression is ok Variables are taken into account Thanks to Mike Kaganski for his help on this patch. Change-Id: Ia6f9c54d90ce88138fd9c9df9422b34ce8223ca2 Reviewed-on: https://gerrit.libreoffice.org/20122 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Mike Kaganski <mikekagan...@hotmail.com> diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1317ec2..8b12d87 100644 --- a/sw/source/core/bastyp/calc.cxx +++ b/sw/source/core/bastyp/calc.cxx @@ -1317,16 +1317,21 @@ SwSbxValue SwCalc::Prim() break; case CALC_NAME: - if( GetToken() == CALC_ASSIGN ) + switch(SwCalcOper nOper = GetToken()) { - SwCalcExp* n = VarInsert( aVarName ); - GetToken(); - nErg = n->nValue = Expr(); - } - else - { - nErg = VarLook( aVarName )->nValue; - bChkPow = true; + case CALC_ASSIGN: + { + SwCalcExp* n = VarInsert(aVarName); + GetToken(); + nErg = n->nValue = Expr(); + } + break; + default: + nErg = VarLook(aVarName)->nValue; + if (nErg.IsVoidValue() && (nOper == CALC_LP)) + eError = CALC_SYNTAX; + else + bChkPow = true; } break; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits