[Libreoffice-commits] core.git: formula/source include/formula sc/source

Laurent Charrière lcharriere at gmail.com
Wed Jan 14 11:52:35 PST 2015


 formula/source/core/api/FormulaCompiler.cxx    |   10 +++++-----
 formula/source/core/api/token.cxx              |   14 +++++++-------
 formula/source/core/resource/core_resource.src |    8 ++++----
 include/formula/FormulaCompiler.hxx            |    2 +-
 include/formula/compiler.hrc                   |    2 +-
 include/formula/opcode.hxx                     |    2 +-
 include/formula/tokenarray.hxx                 |    2 +-
 sc/source/core/inc/interpre.hxx                |    2 +-
 sc/source/core/tool/interpr1.cxx               |    2 +-
 sc/source/core/tool/interpr4.cxx               |    6 +++---
 sc/source/core/tool/parclass.cxx               |    4 ++--
 sc/source/core/tool/token.cxx                  |    4 ++--
 sc/source/filter/excel/xeformula.cxx           |    6 +++---
 sc/source/filter/excel/xlformula.cxx           |    2 +-
 sc/source/filter/lotus/lotform.cxx             |    6 +++---
 sc/source/filter/qpro/qproform.cxx             |    2 +-
 sc/source/ui/src/scfuncs.src                   |    2 +-
 sc/source/ui/unoobj/tokenuno.cxx               |    2 +-
 18 files changed, 39 insertions(+), 39 deletions(-)

New commits:
commit 1f56cbf8cc15f76131d1dc8801935bec92be05ea
Author: Laurent Charrière <lcharriere at gmail.com>
Date:   Mon Jan 12 19:56:39 2015 +0100

    sc: rename ocChose et al. to ocChoose et al.
    
    Change-Id: I1aa8ee6c827a6d6a6c6beb190bdc9c3c91d82b22
    Reviewed-on: https://gerrit.libreoffice.org/13889
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 55a1063..3908378 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -465,7 +465,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
                 SC_OPCODE_IF,
                 SC_OPCODE_IF_ERROR,
                 SC_OPCODE_IF_NA,
-                SC_OPCODE_CHOSE,
+                SC_OPCODE_CHOOSE,
                 SC_OPCODE_AND,
                 SC_OPCODE_OR,
                 SC_OPCODE_NOT,
@@ -814,7 +814,7 @@ bool FormulaCompiler::IsOpCodeJumpCommand( OpCode eOp )
         case ocIf:
         case ocIfError:
         case ocIfNA:
-        case ocChose:
+        case ocChoose:
             return true;
         default:
             ;
@@ -1318,7 +1318,7 @@ void FormulaCompiler::Factor()
                 case ocIf:
                     pFacToken->GetJump()[ 0 ] = 3;  // if, else, behind
                     break;
-                case ocChose:
+                case ocChoose:
                     pFacToken->GetJump()[ 0 ] = FORMULA_MAXJUMPCOUNT + 1;
                     break;
                 case ocIfError:
@@ -1348,7 +1348,7 @@ void FormulaCompiler::Factor()
                 case ocIf:
                     nJumpMax = 3;
                     break;
-                case ocChose:
+                case ocChoose:
                     nJumpMax = FORMULA_MAXJUMPCOUNT;
                     break;
                 case ocIfError:
@@ -1385,7 +1385,7 @@ void FormulaCompiler::Factor()
                     case ocIf:
                         bLimitOk = (nJumpCount <= 3);
                         break;
-                    case ocChose:
+                    case ocChoose:
                         bLimitOk = (nJumpCount < FORMULA_MAXJUMPCOUNT); /* TODO: check, really <, not <=? */
                         break;
                     case ocIfError:
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 0ae7059..e033835 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -81,7 +81,7 @@ bool FormulaToken::IsFunction() const
             eOp != ocColRowNameAuto && eOp != ocName && eOp != ocDBArea &&
            (GetByte() != 0                                                  // x parameters
         || (SC_OPCODE_START_NO_PAR <= eOp && eOp < SC_OPCODE_STOP_NO_PAR)   // no parameter
-        || (ocIf == eOp || ocIfError == eOp || ocIfNA == eOp || ocChose == eOp ) // @ jump commands
+        || (ocIf == eOp || ocIfError == eOp || ocIfNA == eOp || ocChoose == eOp ) // @ jump commands
         || (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR)     // one parameter
         || (SC_OPCODE_START_2_PAR <= eOp && eOp < SC_OPCODE_STOP_2_PAR)     // x parameters (cByte==0 in
                                                                             // FuncAutoPilot)
@@ -96,10 +96,10 @@ bool FormulaToken::IsFunction() const
 sal_uInt8 FormulaToken::GetParamCount() const
 {
     if ( eOp < SC_OPCODE_STOP_DIV && eOp != ocExternal && eOp != ocMacro &&
-         eOp != ocIf && eOp != ocIfError && eOp != ocIfNA && eOp != ocChose &&
+         eOp != ocIf && eOp != ocIfError && eOp != ocIfNA && eOp != ocChoose &&
          eOp != ocPercentSign )
         return 0;       // parameters and specials
-                        // ocIf, ocIfError, ocIfNA and ocChose not for FAP, have cByte then
+                        // ocIf, ocIfError, ocIfNA and ocChoose not for FAP, have cByte then
 //2do: bool parameter whether FAP or not?
     else if ( GetByte() )
         return GetByte();   // all functions, also ocExternal and ocMacro
@@ -112,7 +112,7 @@ sal_uInt8 FormulaToken::GetParamCount() const
         return 0;           // no parameter
     else if (SC_OPCODE_START_1_PAR <= eOp && eOp < SC_OPCODE_STOP_1_PAR)
         return 1;           // one parameter
-    else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChose )
+    else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChoose )
         return 1;           // only the condition counts as parameter
     else
         return 0;           // all the rest, no Parameter, or
@@ -967,7 +967,7 @@ bool FormulaTokenArray::HasMatrixDoubleRefOps()
             }
             if ( eOp == ocPush || lcl_IsReference( eOp, t->GetType() )  )
                 pStack[sp++] = t;
-            else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChose )
+            else if ( eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChoose )
             {   // ignore Jumps, pop previous Result (Condition)
                 if ( sp )
                     --sp;
@@ -1441,12 +1441,12 @@ FormulaToken* FormulaTokenArray::AddOpCode( OpCode eOp )
         case ocIf:
         case ocIfError:
         case ocIfNA:
-        case ocChose:
+        case ocChoose:
             {
                 short nJump[FORMULA_MAXJUMPCOUNT + 1];
                 if ( eOp == ocIf )
                     nJump[ 0 ] = 3;
-                else if ( eOp == ocChose )
+                else if ( eOp == ocChoose )
                     nJump[ 0 ] = FORMULA_MAXJUMPCOUNT + 1;
                 else
                     nJump[ 0 ] = 2;
diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index 3dfec5c..3d28399 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -27,7 +27,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_IF { Text = "IF" ; };
     String SC_OPCODE_IF_ERROR { Text = "IFERROR" ; };
     String SC_OPCODE_IF_NA { Text = "IFNA" ; };
-    String SC_OPCODE_CHOSE { Text = "CHOOSE" ; };
+    String SC_OPCODE_CHOOSE { Text = "CHOOSE" ; };
     String SC_OPCODE_OPEN { Text = "(" ; };
     String SC_OPCODE_CLOSE { Text = ")" ; };
     String SC_OPCODE_ARRAY_OPEN { Text = "{" ; };
@@ -435,7 +435,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
     String SC_OPCODE_IF { Text = "IF" ; };
     String SC_OPCODE_IF_ERROR { Text = "IFERROR" ; };
     String SC_OPCODE_IF_NA { Text = "_xlfn.IFNA" ; };
-    String SC_OPCODE_CHOSE { Text = "CHOOSE" ; };
+    String SC_OPCODE_CHOOSE { Text = "CHOOSE" ; };
     String SC_OPCODE_OPEN { Text = "(" ; };
     String SC_OPCODE_CLOSE { Text = ")" ; };
     String SC_OPCODE_ARRAY_OPEN { Text = "{" ; };
@@ -845,7 +845,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_IF { Text = "IF" ; };
     String SC_OPCODE_IF_ERROR { Text = "IFERROR" ; };
     String SC_OPCODE_IF_NA { Text = "IFNA" ; };
-    String SC_OPCODE_CHOSE { Text = "CHOOSE" ; };
+    String SC_OPCODE_CHOOSE { Text = "CHOOSE" ; };
     String SC_OPCODE_OPEN { Text = "(" ; };
     String SC_OPCODE_CLOSE { Text = ")" ; };
     String SC_OPCODE_ARRAY_OPEN { Text = "{" ; };
@@ -1261,7 +1261,7 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "IFNA" ;
     };
-    String SC_OPCODE_CHOSE
+    String SC_OPCODE_CHOOSE
     {
         Text [ en-US ] = "CHOOSE" ;
     };
diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx
index 488760e..0d959c6 100644
--- a/include/formula/FormulaCompiler.hxx
+++ b/include/formula/FormulaCompiler.hxx
@@ -37,7 +37,7 @@
 
 #include <unordered_map>
 
-#define FORMULA_MAXJUMPCOUNT    32  /* maximum number of jumps (ocChose) */
+#define FORMULA_MAXJUMPCOUNT    32  /* maximum number of jumps (ocChoose) */
 #define FORMULA_MAXTOKENS     8192  /* maximum number of tokens in formula */
 
 
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 9578a2a..cc8b709 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -32,7 +32,7 @@
 #define SC_OPCODE_IF                  6     /* jump commands */
 #define SC_OPCODE_IF_ERROR            7
 #define SC_OPCODE_IF_NA               8
-#define SC_OPCODE_CHOSE               9
+#define SC_OPCODE_CHOOSE              9
 #define SC_OPCODE_OPEN               10     /* parentheses and separators */
 #define SC_OPCODE_CLOSE              11
 #define SC_OPCODE_SEP                12
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 25da573..b7cdba5 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -36,7 +36,7 @@ enum OpCode : sal_uInt16
         ocIf                = SC_OPCODE_IF,
         ocIfError           = SC_OPCODE_IF_ERROR,
         ocIfNA              = SC_OPCODE_IF_NA,
-        ocChose             = SC_OPCODE_CHOSE,
+        ocChoose            = SC_OPCODE_CHOOSE,
     // Parentheses and separators
         ocOpen              = SC_OPCODE_OPEN,
         ocClose             = SC_OPCODE_CLOSE,
diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx
index e37f751..244a7b9 100644
--- a/include/formula/tokenarray.hxx
+++ b/include/formula/tokenarray.hxx
@@ -321,7 +321,7 @@ public:
         @param nStop
             Stop before reaching code at position nStop. If not specified the
             default is to either run the entire code, or to stop if an ocSep or
-            ocClose is encountered, which are only present in ocIf or ocChose
+            ocClose is encountered, which are only present in ocIf or ocChoose
             jumps.
       */
     void Jump( short nStart, short nNext, short nStop = SHRT_MAX );
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index e3b85a3..1a59d10 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -396,7 +396,7 @@ bool LookupQueryWithCache( ScAddress & o_rResultPos,
 
 void ScIfJump();
 void ScIfError( bool bNAonly );
-void ScChoseJump();
+void ScChooseJump();
 
 // Be sure to only call this if pStack[sp-nStackLevel] really contains a
 // ScJumpMatrixToken, no further checks are applied!
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 77dfcad..2c58fcc 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -396,7 +396,7 @@ void ScInterpreter::ScIfError( bool bNAonly )
     }
 }
 
-void ScInterpreter::ScChoseJump()
+void ScInterpreter::ScChooseJump()
 {
     // We have to set a jump, if there was none chosen because of an error set
     // it to endpoint.
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 311f86d..18cbb93 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3812,7 +3812,7 @@ StackVar ScInterpreter::Interpret()
             PushWithoutError( (FormulaToken&) *pCur );
         }
         else if (pTokenMatrixMap &&
-                 !(eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChose) &&
+                 !(eOp == ocIf || eOp == ocIfError || eOp == ocIfNA || eOp == ocChoose) &&
                 ((aTokenMatrixMapIter = pTokenMatrixMap->find( pCur)) !=
                  pTokenMatrixMap->end()) &&
                 (*aTokenMatrixMapIter).second->GetType() != svJumpMatrix)
@@ -3833,7 +3833,7 @@ StackVar ScInterpreter::Interpret()
             nFuncFmtType = NUMBERFORMAT_NUMBER;
             nFuncFmtIndex = 0;
 
-            if ( eOp == ocIf || eOp == ocChose || eOp == ocIfError || eOp == ocIfNA )
+            if ( eOp == ocIf || eOp == ocChoose || eOp == ocIfError || eOp == ocIfNA )
                 nStackBase = sp;        // don't mess around with the jumps
             else
             {
@@ -3862,7 +3862,7 @@ StackVar ScInterpreter::Interpret()
                 case ocIf               : ScIfJump();                   break;
                 case ocIfError          : ScIfError( false );           break;
                 case ocIfNA             : ScIfError( true );            break;
-                case ocChose            : ScChoseJump();                break;
+                case ocChoose           : ScChooseJump();                break;
                 case ocAdd              : ScAdd();                      break;
                 case ocSub              : ScSub();                      break;
                 case ocMul              : ScMul();                      break;
diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index b066c5c..1f56407 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -56,7 +56,7 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] =
     { ocIf,              {{ Array, Reference, Reference                          }, 0 }},
     { ocIfError,         {{ Array, Reference                                     }, 0 }},
     { ocIfNA,            {{ Array, Reference                                     }, 0 }},
-    { ocChose,           {{ Array, Reference                                     }, 1 }},
+    { ocChoose,          {{ Array, Reference                                     }, 1 }},
     // Other specials.
     { ocOpen,            {{ Bounds                                               }, 0 }},
     { ocClose,           {{ Bounds                                               }, 0 }},
@@ -509,7 +509,7 @@ void ScParameterClassification::GenerateDocumentation()
                     break;
                     case ocIfError:
                     case ocIfNA:
-                    case ocChose:
+                    case ocChoose:
                         aToken.SetByte(2);
                     break;
                     case ocPercentSign:
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 0aa1f47..1d1f916 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -154,7 +154,7 @@ void ScRawToken::SetOpCode( OpCode e )
             eType = svJump;
             nJump[ 0 ] = 2; // If, Behind
             break;
-        case ocChose:
+        case ocChoose:
             eType = svJump;
             nJump[ 0 ] = FORMULA_MAXJUMPCOUNT + 1;
             break;
@@ -1153,7 +1153,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
             case ocIf:
             case ocIfError:
             case ocIfNA:
-            case ocChose:
+            case ocChoose:
                 // Jump commands are now supported.
             break;
             case ocAverage:
diff --git a/sc/source/filter/excel/xeformula.cxx b/sc/source/filter/excel/xeformula.cxx
index 145aaf3..752c6a9 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1433,7 +1433,7 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC
         switch( rFuncData.GetOpCode() )
         {
             case ocIf:
-            case ocChose:
+            case ocChoose:
                 AppendJumpToken( rFuncData, EXC_TOK_ATTR_GOTO );
             break;
             default:;
@@ -1451,7 +1451,7 @@ void XclExpFmlaCompImpl::FinishFunction( XclExpFuncData& rFuncData, sal_uInt8 nC
             case ocIf:
                 FinishIfFunction( rFuncData );
             break;
-            case ocChose:
+            case ocChoose:
                 FinishChooseFunction( rFuncData );
             break;
 
@@ -1574,7 +1574,7 @@ void XclExpFmlaCompImpl::PrepareParam( XclExpFuncData& rFuncData )
             }
         break;
 
-        case ocChose:
+        case ocChoose:
             switch( nParamIdx )
             {
                 // do nothing for first parameter
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index cd019cf..5d721a5 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -163,7 +163,7 @@ static const XclFunctionInfo saFuncTable_2[] =
     { ocArcTan2,            97,     2,  2,  V, { VR }, 0, 0 },
     { ocArcSin,             98,     1,  1,  V, { VR }, 0, 0 },
     { ocArcCos,             99,     1,  1,  V, { VR }, 0, 0 },
-    { ocChose,              100,    2,  MX, R, { VO, RO }, 0, 0 },
+    { ocChoose,             100,    2,  MX, R, { VO, RO }, 0, 0 },
     { ocHLookup,            101,    3,  3,  V, { VV, RO, RO, C }, 0, 0 },
     { ocVLookup,            102,    3,  3,  V, { VV, RO, RO, C }, 0, 0 },
     { ocIsRef,              105,    1,  1,  V, { RX }, 0, 0 },
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index a4ef34e..9e83d44 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -105,7 +105,7 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
             aPool << ocOpen;
         }
             break;
-        case ocChose:
+        case ocChoose:
         {// 1. Parameter ++
             if (nAnz >= 1)
                 IncToken( eParam[ nAnz - 1 ] );
@@ -974,7 +974,7 @@ DefTokenId LotusToSc::IndexToToken( sal_uInt8 nIndex )
         ocArcCos,           //   45 Arcus-Cosinus
         ocExp,              //   46 Exponential function
         ocMod,              //   47 Modulo
-        ocChose,            //   48 Selection
+        ocChoose,           //   48 Selection
         ocIsNA,             //   49 Is not available?
         ocIsError,          //   50 Is Error?
         ocFalse,            //   51 FALSE
@@ -1503,7 +1503,7 @@ DefTokenId LotusToSc::IndexToTokenWK123( sal_uInt8 nIndex )
         ocArcCos,           //   45 Arcus-Cosinus
         ocExp,              //   46 Exponentialfunction
         ocMod,              //   47 Modulo
-        ocChose,            //   48 Selection
+        ocChoose,            //   48 Selection
         ocIsNA,             //   49 Is not available?
         ocIsError,          //   50 Is Error?
         ocFalse,            //   51 FALSE
diff --git a/sc/source/filter/qpro/qproform.cxx b/sc/source/filter/qpro/qproform.cxx
index ab1c80d..a63eed1 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -420,7 +420,7 @@ static const struct
     { ocArcCos, FT_FuncFix1 },
     { ocExp, FT_FuncFix1 },
     { ocMod, FT_FuncFix2 },
-    { ocChose, FT_FuncVar },                    // 0x30
+    { ocChoose, FT_FuncVar },                    // 0x30
     { ocIsNA, FT_FuncFix1 },
     { ocIsError, FT_FuncFix1 },
     { ocFalse, FT_FuncFix0 },
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index b6b3c98..748d373 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -9899,7 +9899,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
         };
     };
      // -=*# Resource for function CHOOSE #*=-
-    Resource SC_OPCODE_CHOSE
+    Resource SC_OPCODE_CHOOSE
     {
         String 1 // Description
         {
diff --git a/sc/source/ui/unoobj/tokenuno.cxx b/sc/source/ui/unoobj/tokenuno.cxx
index a918eb3..a260705 100644
--- a/sc/source/ui/unoobj/tokenuno.cxx
+++ b/sc/source/ui/unoobj/tokenuno.cxx
@@ -480,7 +480,7 @@ bool ScTokenConversion::ConvertToTokenSequence( const ScDocument& rDoc,
                     OSL_TRACE( "ScTokenConversion::ConvertToTokenSequence: unhandled token type SvStackVar %d", rToken.GetType());
                     //fall-through
                 case svSep:     // occurs with ocSep, ocOpen, ocClose, ocArray*
-                case svJump:    // occurs with ocIf, ocChose
+                case svJump:    // occurs with ocIf, ocChoose
                 case svMissing: // occurs with ocMissing
                     rAPI.Data.clear();      // no data
             }


More information about the Libreoffice-commits mailing list