sw/source/core/bastyp/calc.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-)
New commits: commit 238a02cb567768ff0d7338ddab87441ec5e5d470 Author: Julien Nabet <[email protected]> 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 <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit d667e3210b12c7ce3b3727e2a0e369a520fbaaa4) Reviewed-on: https://gerrit.libreoffice.org/20159 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx index 1eb97f3..4e82bb4 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 [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
