[Libreoffice-commits] core.git: sw/source

Mike Kaganski mike.kaganski at collabora.com
Tue Nov 24 20:04:19 PST 2015


 sw/source/core/bastyp/calc.cxx |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

New commits:
commit a15b9b44d933ef06efbc231d66b79815ba69ceff
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Wed Nov 25 13:15:13 2015 +1000

    tdf#61228: formatting and commenting
    
    Change-Id: Ic5d1090722945dce338973e9e3091546ed792057
    Reviewed-on: https://gerrit.libreoffice.org/20160
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mikekaganski at hotmail.com>

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 8b12d87..7864657 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;


More information about the Libreoffice-commits mailing list