[Libreoffice-commits] core.git: 5 commits - scaddins/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Feb 7 08:50:20 UTC 2017


 scaddins/source/analysis/analysis.cxx       |   25 +--
 scaddins/source/analysis/analysishelper.cxx |  202 ++++++++++++++--------------
 scaddins/source/analysis/analysishelper.hxx |   27 +--
 scaddins/source/datefunc/datefunc.cxx       |   44 ++----
 scaddins/source/datefunc/datefunc.hxx       |   19 +-
 scaddins/source/pricing/pricing.cxx         |   35 ++--
 scaddins/source/pricing/pricing.hxx         |   19 +-
 7 files changed, 176 insertions(+), 195 deletions(-)

New commits:
commit c421cab5bdd883fd547804b37f654fb9f4a59b38
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 7 09:42:33 2017 +0200

    remove more STR_FROM_ANSI macro
    
    Change-Id: I0957d1162c7b5bf8f52c7a79aaced667961d40a3

diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 022a89c..be52c92 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -44,8 +44,6 @@ using namespace sca::pricing;
 #define MY_SERVICE              "com.sun.star.sheet.addin.PricingFunctions"
 #define MY_IMPLNAME             "com.sun.star.sheet.addin.PricingFunctionsImpl"
 
-#define STR_FROM_ANSI( s )      OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 )
-
 ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
     ResId( nId, rResMgr )
 {
@@ -299,11 +297,11 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayFunctionName( const OUString& aProg
     {
         aRet = ScaResStringLoader( RID_PRICING_FUNCTION_NAMES, fDataIt->GetUINameID(), GetResMgr() ).GetString();
         if( fDataIt->IsDouble() )
-            aRet += STR_FROM_ANSI( "_ADD" );
+            aRet += "_ADD";
     }
     else
     {
-        aRet = STR_FROM_ANSI( "UNKNOWNFUNC_" );
+        aRet = "UNKNOWNFUNC_";
         aRet += aProgrammaticName;
     }
 
@@ -335,7 +333,7 @@ OUString SAL_CALL ScaPricingAddIn::getDisplayArgumentName(
         if( nStr )
             aRet = GetFuncDescrStr( fDataIt->GetDescrID(), nStr );
         else
-            aRet = STR_FROM_ANSI( "internal" );
+            aRet = "internal";
     }
 
     return aRet;
@@ -354,7 +352,7 @@ OUString SAL_CALL ScaPricingAddIn::getArgumentDescription(
         if( nStr )
             aRet = GetFuncDescrStr( fDataIt->GetDescrID(), nStr + 1 );
         else
-            aRet = STR_FROM_ANSI( "for internal use only" );
+            aRet = "for internal use only";
     }
 
     return aRet;
@@ -371,17 +369,17 @@ OUString SAL_CALL ScaPricingAddIn::getProgrammaticCategoryName(
     {
         switch( fDataIt->GetCategory() )
         {
-            case ScaCategory::DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
-            case ScaCategory::Text:       aRet = STR_FROM_ANSI( "Text" );         break;
-            case ScaCategory::Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
-            case ScaCategory::Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
-            case ScaCategory::Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
-            case ScaCategory::Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
+            case ScaCategory::DateTime:   aRet = "Date&Time";    break;
+            case ScaCategory::Text:       aRet = "Text";         break;
+            case ScaCategory::Finance:    aRet = "Financial";    break;
+            case ScaCategory::Inf:        aRet = "Information";  break;
+            case ScaCategory::Math:       aRet = "Mathematical"; break;
+            case ScaCategory::Tech:       aRet = "Technical";    break;
         }
     }
 
     if( aRet.isEmpty() )
-        aRet = STR_FROM_ANSI( "Add-In" );
+        aRet = "Add-In";
     return aRet;
 }
 
commit 99330e7b35b71bdc2a765a24ad8a25f6067aa3a6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 7 09:41:03 2017 +0200

    convert ScaCategory to scoped enum
    
    and drop unused AddIn constant
    
    Change-Id: Ic775e3c956c7200bb04be0a776a688284ba9d19b

diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index b5e6960..022a89c 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -60,10 +60,10 @@ ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
 
 const ScaFuncDataBase pFuncDataArr[] =
 {
-   FUNCDATA( OptBarrier,       13, ScaCat_Finance,    UNIQUE,  STDPAR),
-   FUNCDATA( OptTouch,         11, ScaCat_Finance,    UNIQUE,  STDPAR),
-   FUNCDATA( OptProbHit,        6, ScaCat_Finance,    UNIQUE,  STDPAR),
-   FUNCDATA( OptProbInMoney,    8, ScaCat_Finance,    UNIQUE,  STDPAR)
+   FUNCDATA( OptBarrier,       13, ScaCategory::Finance,    UNIQUE,  STDPAR),
+   FUNCDATA( OptTouch,         11, ScaCategory::Finance,    UNIQUE,  STDPAR),
+   FUNCDATA( OptProbHit,        6, ScaCategory::Finance,    UNIQUE,  STDPAR),
+   FUNCDATA( OptProbInMoney,    8, ScaCategory::Finance,    UNIQUE,  STDPAR)
 };
 
 #undef FUNCDATA
@@ -371,15 +371,12 @@ OUString SAL_CALL ScaPricingAddIn::getProgrammaticCategoryName(
     {
         switch( fDataIt->GetCategory() )
         {
-            case ScaCat_DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
-            case ScaCat_Text:       aRet = STR_FROM_ANSI( "Text" );         break;
-            case ScaCat_Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
-            case ScaCat_Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
-            case ScaCat_Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
-            case ScaCat_Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
-            // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
-            default:
-                break;
+            case ScaCategory::DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
+            case ScaCategory::Text:       aRet = STR_FROM_ANSI( "Text" );         break;
+            case ScaCategory::Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
+            case ScaCategory::Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
+            case ScaCategory::Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
+            case ScaCategory::Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
         }
     }
 
diff --git a/scaddins/source/pricing/pricing.hxx b/scaddins/source/pricing/pricing.hxx
index d3cb74f..3fa96cd 100644
--- a/scaddins/source/pricing/pricing.hxx
+++ b/scaddins/source/pricing/pricing.hxx
@@ -111,15 +111,14 @@ public:
 };
 
 
-enum ScaCategory
+enum class ScaCategory
 {
-    ScaCat_AddIn,
-    ScaCat_DateTime,
-    ScaCat_Text,
-    ScaCat_Finance,
-    ScaCat_Inf,
-    ScaCat_Math,
-    ScaCat_Tech
+    DateTime,
+    Text,
+    Finance,
+    Inf,
+    Math,
+    Tech
 };
 
 struct ScaFuncDataBase
@@ -130,8 +129,8 @@ struct ScaFuncDataBase
     sal_uInt16                  nCompListID;        // resource ID to list of valid names
     sal_uInt16                  nParamCount;        // number of named / described parameters
     ScaCategory                 eCat;               // function category
-    bool                    bDouble;            // name already exist in Calc
-    bool                    bWithOpt;           // first parameter is internal
+    bool                        bDouble;            // name already exist in Calc
+    bool                        bWithOpt;           // first parameter is internal
 };
 
 class ScaFuncData final
commit 4dc6dee3aa76085a308df5a71872cb40ef5d3aaa
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 7 09:38:56 2017 +0200

    remove unnecessary STR_FROM_ANSI macro
    
    Change-Id: I262158991a83083f999b0ae48da4ed4d77fc57fe

diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index 9bf44cb..d476bc5 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -34,9 +34,6 @@ using namespace ::com::sun::star;
 #define MY_SERVICE              "com.sun.star.sheet.addin.DateFunctions"
 #define MY_IMPLNAME             "com.sun.star.sheet.addin.DateFunctionsImpl"
 
-#define STR_FROM_ANSI( s )      OUString( s, strlen( s ), RTL_TEXTENCODING_MS_1252 )
-
-
 ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
     ResId( nId, rResMgr )
 {
@@ -281,11 +278,11 @@ OUString SAL_CALL ScaDateAddIn::getDisplayFunctionName( const OUString& aProgram
     {
         aRet = ScaResStringLoader( RID_DATE_FUNCTION_NAMES, fDataIt->GetUINameID(), GetResMgr() ).GetString();
         if( fDataIt->IsDouble() )
-            aRet += STR_FROM_ANSI( "_ADD" );
+            aRet += "_ADD";
     }
     else
     {
-        aRet = STR_FROM_ANSI( "UNKNOWNFUNC_" );
+        aRet = "UNKNOWNFUNC_";
         aRet += aProgrammaticName;
     }
 
@@ -317,7 +314,7 @@ OUString SAL_CALL ScaDateAddIn::getDisplayArgumentName(
         if( nStr )
             aRet = GetFuncDescrStr( fDataIt->GetDescrID(), nStr );
         else
-            aRet = STR_FROM_ANSI( "internal" );
+            aRet = "internal";
     }
 
     return aRet;
@@ -336,7 +333,7 @@ OUString SAL_CALL ScaDateAddIn::getArgumentDescription(
         if( nStr )
             aRet = GetFuncDescrStr( fDataIt->GetDescrID(), nStr + 1 );
         else
-            aRet = STR_FROM_ANSI( "for internal use only" );
+            aRet = "for internal use only";
     }
 
     return aRet;
@@ -353,17 +350,17 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName(
     {
         switch( fDataIt->GetCategory() )
         {
-            case ScaCategory::DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
-            case ScaCategory::Text:       aRet = STR_FROM_ANSI( "Text" );         break;
-            case ScaCategory::Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
-            case ScaCategory::Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
-            case ScaCategory::Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
-            case ScaCategory::Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
+            case ScaCategory::DateTime:   aRet = "Date&Time";    break;
+            case ScaCategory::Text:       aRet = "Text";         break;
+            case ScaCategory::Finance:    aRet = "Financial";    break;
+            case ScaCategory::Inf:        aRet = "Information";  break;
+            case ScaCategory::Math:       aRet = "Mathematical"; break;
+            case ScaCategory::Tech:       aRet = "Technical";    break;
         }
     }
 
     if( aRet.isEmpty() )
-        aRet = STR_FROM_ANSI( "Add-In" );
+        aRet = "Add-In";
     return aRet;
 }
 
commit 75b7b685cecde509bb305dc370448f42010d00da
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 7 09:37:01 2017 +0200

    convert ScaCategory to scoped enum
    
    and drop unused AddIn constant
    
    Change-Id: I4422f34db756649cb08aa9aa7f975cef73ccfa91

diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index d5e0d9a..9bf44cb 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -52,14 +52,14 @@ ScaResId::ScaResId( sal_uInt16 nId, ResMgr& rResMgr ) :
 
 const ScaFuncDataBase pFuncDataArr[] =
 {
-    FUNCDATA( DiffWeeks,    3, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( DiffMonths,   3, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( DiffYears,    3, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( IsLeapYear,   1, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( DaysInMonth,  1, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( DaysInYear,   1, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( WeeksInYear,  1, ScaCat_DateTime, UNIQUE, INTPAR ),
-    FUNCDATA( Rot13,        1, ScaCat_Text,     UNIQUE, STDPAR )
+    FUNCDATA( DiffWeeks,    3, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( DiffMonths,   3, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( DiffYears,    3, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( IsLeapYear,   1, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( DaysInMonth,  1, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( DaysInYear,   1, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( WeeksInYear,  1, ScaCategory::DateTime, UNIQUE, INTPAR ),
+    FUNCDATA( Rot13,        1, ScaCategory::Text,     UNIQUE, STDPAR )
 };
 
 #undef FUNCDATA
@@ -353,15 +353,12 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName(
     {
         switch( fDataIt->GetCategory() )
         {
-            case ScaCat_DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
-            case ScaCat_Text:       aRet = STR_FROM_ANSI( "Text" );         break;
-            case ScaCat_Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
-            case ScaCat_Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
-            case ScaCat_Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
-            case ScaCat_Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
-            // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
-            default:
-                break;
+            case ScaCategory::DateTime:   aRet = STR_FROM_ANSI( "Date&Time" );    break;
+            case ScaCategory::Text:       aRet = STR_FROM_ANSI( "Text" );         break;
+            case ScaCategory::Finance:    aRet = STR_FROM_ANSI( "Financial" );    break;
+            case ScaCategory::Inf:        aRet = STR_FROM_ANSI( "Information" );  break;
+            case ScaCategory::Math:       aRet = STR_FROM_ANSI( "Mathematical" ); break;
+            case ScaCategory::Tech:       aRet = STR_FROM_ANSI( "Technical" );    break;
         }
     }
 
diff --git a/scaddins/source/datefunc/datefunc.hxx b/scaddins/source/datefunc/datefunc.hxx
index c0637d6..1a30f8a 100644
--- a/scaddins/source/datefunc/datefunc.hxx
+++ b/scaddins/source/datefunc/datefunc.hxx
@@ -102,15 +102,14 @@ public:
 };
 
 
-enum ScaCategory
+enum class ScaCategory
 {
-    ScaCat_AddIn,
-    ScaCat_DateTime,
-    ScaCat_Text,
-    ScaCat_Finance,
-    ScaCat_Inf,
-    ScaCat_Math,
-    ScaCat_Tech
+    DateTime,
+    Text,
+    Finance,
+    Inf,
+    Math,
+    Tech
 };
 
 struct ScaFuncDataBase
@@ -121,8 +120,8 @@ struct ScaFuncDataBase
     sal_uInt16                  nCompListID;        // resource ID to list of valid names
     sal_uInt16                  nParamCount;        // number of named / described parameters
     ScaCategory                 eCat;               // function category
-    bool                    bDouble;            // name already exist in Calc
-    bool                    bWithOpt;           // first parameter is internal
+    bool                        bDouble;            // name already exist in Calc
+    bool                        bWithOpt;           // first parameter is internal
 };
 
 class ScaFuncData final
commit de9c7e4d94da2c392564604c8b07ba323f564981
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Feb 7 09:32:11 2017 +0200

    convert FDCategory to scoped enum
    
    and drop unused AddIn constant
    
    Change-Id: I9cb07d58d7c986973d9713572538ce2142654397

diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index c8f5bf5..7cf11cb 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -355,13 +355,11 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aN
     {
         switch( it->GetCategory() )
         {
-            case FDCat_DateTime:    aRet = "Date&Time";         break;
-            case FDCat_Finance:     aRet = "Financial";         break;
-            case FDCat_Inf:         aRet = "Information";       break;
-            case FDCat_Math:        aRet = "Mathematical";      break;
-            case FDCat_Tech:        aRet = "Technical";         break;
-            default:
-                                    aRet = pDefCatName;         break;
+            case FDCategory::DateTime:    aRet = "Date&Time";         break;
+            case FDCategory::Finance:     aRet = "Financial";         break;
+            case FDCategory::Inf:         aRet = "Information";       break;
+            case FDCategory::Math:        aRet = "Mathematical";      break;
+            case FDCategory::Tech:        aRet = "Technical";         break;
         }
     }
     else
@@ -373,20 +371,17 @@ OUString SAL_CALL AnalysisAddIn::getProgrammaticCategoryName( const OUString& aN
 OUString SAL_CALL AnalysisAddIn::getDisplayCategoryName( const OUString& aProgrammaticFunctionName )
 {
     //  return translated strings, not used for predefined categories
-    //  return OUString( "Add-In" );
     auto it = std::find_if(pFD->begin(), pFD->end(), FindFuncData( aProgrammaticFunctionName ) );
     OUString              aRet;
     if( it != pFD->end() )
     {
         switch( it->GetCategory() )
         {
-            case FDCat_DateTime:    aRet = "Date&Time";         break;
-            case FDCat_Finance:     aRet = "Financial";         break;
-            case FDCat_Inf:         aRet = "Information";       break;
-            case FDCat_Math:        aRet = "Mathematical";      break;
-            case FDCat_Tech:        aRet = "Technical";         break;
-            default:
-                                    aRet = pDefCatName;         break;
+            case FDCategory::DateTime:    aRet = "Date&Time";         break;
+            case FDCategory::Finance:     aRet = "Financial";         break;
+            case FDCategory::Inf:         aRet = "Information";       break;
+            case FDCategory::Math:        aRet = "Mathematical";      break;
+            case FDCategory::Tech:        aRet = "Technical";         break;
         }
     }
     else
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index a3bedca..355217c 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -50,107 +50,107 @@ const FuncDataBase pFuncDatas[] =
 {
     //                          UNIQUE or   INTPAR or
     //         function name     DOUBLE      STDPAR     # of param  category
-    FUNCDATA( Workday,          UNIQUE,     INTPAR,     3,          FDCat_DateTime ),
-    FUNCDATA( Yearfrac,         UNIQUE,     INTPAR,     3,          FDCat_DateTime ),
-    FUNCDATA( Edate,            UNIQUE,     INTPAR,     2,          FDCat_DateTime ),
-    FUNCDATAS( Weeknum,         DOUBLE,     INTPAR,     2,          FDCat_DateTime, "_EXCEL2003" ),
-    FUNCDATA( Eomonth,          UNIQUE,     INTPAR,     2,          FDCat_DateTime ),
-    FUNCDATAS( Networkdays,     DOUBLE,     INTPAR,     3,          FDCat_DateTime, "_EXCEL2003" ),
-    FUNCDATA( Iseven,           DOUBLE,     STDPAR,     1,          FDCat_Inf ),
-    FUNCDATA( Isodd,            DOUBLE,     STDPAR,     1,          FDCat_Inf ),
-    FUNCDATA( Multinomial,      UNIQUE,     STDPAR,     1,          FDCat_Math ),
-    FUNCDATA( Seriessum,        UNIQUE,     STDPAR,     4,          FDCat_Math ),
-    FUNCDATA( Quotient,         UNIQUE,     STDPAR,     2,          FDCat_Math ),
-    FUNCDATA( Mround,           UNIQUE,     STDPAR,     2,          FDCat_Math ),
-    FUNCDATA( Sqrtpi,           UNIQUE,     STDPAR,     1,          FDCat_Math ),
-    FUNCDATA( Randbetween,      UNIQUE,     STDPAR,     2,          FDCat_Math ),
-    FUNCDATAS( Gcd,             DOUBLE,     INTPAR,     1,          FDCat_Math, "_EXCEL2003" ),
-    FUNCDATAS( Lcm,             DOUBLE,     INTPAR,     1,          FDCat_Math, "_EXCEL2003" ),
-    FUNCDATA( Besseli,          UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Besselj,          UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Besselk,          UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Bessely,          UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Bin2Oct,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Bin2Dec,          UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Bin2Hex,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Oct2Bin,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Oct2Dec,          UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Oct2Hex,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Dec2Bin,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Dec2Hex,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Dec2Oct,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Hex2Bin,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Hex2Dec,          UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Hex2Oct,          UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Delta,            UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Erf,              UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Erfc,             UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Gestep,           UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Factdouble,       UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imabs,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imaginary,        UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Impower,          UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Imargument,       UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imcos,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imdiv,            UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Imexp,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imconjugate,      UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imln,             UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imlog10,          UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imlog2,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Improduct,        UNIQUE,     INTPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Imreal,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsin,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsub,            UNIQUE,     STDPAR,     2,          FDCat_Tech ),
-    FUNCDATA( Imsqrt,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsum,            UNIQUE,     INTPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imtan,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsec,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imcsc,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imcot,            UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsinh,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imcosh,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imsech,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Imcsch,           UNIQUE,     STDPAR,     1,          FDCat_Tech ),
-    FUNCDATA( Complex,          UNIQUE,     STDPAR,     3,          FDCat_Tech ),
-    FUNCDATA( Convert,          UNIQUE,     STDPAR,     3,          FDCat_Tech ),
-    FUNCDATA( Amordegrc,        UNIQUE,     INTPAR,     7,          FDCat_Finance ),
-    FUNCDATA( Amorlinc,         UNIQUE,     INTPAR,     7,          FDCat_Finance ),
-    FUNCDATA( Accrint,          UNIQUE,     INTPAR,     7,          FDCat_Finance ),
-    FUNCDATA( Accrintm,         UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Received,         UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Disc,             UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Duration,         UNIQUE,     INTPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Effect,           DOUBLE,     STDPAR,     2,          FDCat_Finance ),
-    FUNCDATA( Cumprinc,         DOUBLE,     STDPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Cumipmt,          DOUBLE,     STDPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Price,            UNIQUE,     INTPAR,     7,          FDCat_Finance ),
-    FUNCDATA( Pricedisc,        UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Pricemat,         UNIQUE,     INTPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Mduration,        UNIQUE,     INTPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Nominal,          DOUBLE,     STDPAR,     2,          FDCat_Finance ),
-    FUNCDATA( Dollarfr,         UNIQUE,     STDPAR,     2,          FDCat_Finance ),
-    FUNCDATA( Dollarde,         UNIQUE,     STDPAR,     2,          FDCat_Finance ),
-    FUNCDATA( Yield,            UNIQUE,     INTPAR,     7,          FDCat_Finance ),
-    FUNCDATA( Yielddisc,        UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Yieldmat,         UNIQUE,     INTPAR,     6,          FDCat_Finance ),
-    FUNCDATA( Tbilleq,          UNIQUE,     INTPAR,     3,          FDCat_Finance ),
-    FUNCDATA( Tbillprice,       UNIQUE,     INTPAR,     3,          FDCat_Finance ),
-    FUNCDATA( Tbillyield,       UNIQUE,     INTPAR,     3,          FDCat_Finance ),
-    FUNCDATA( Oddfprice,        UNIQUE,     INTPAR,     9,          FDCat_Finance ),
-    FUNCDATA( Oddfyield,        UNIQUE,     INTPAR,     9,          FDCat_Finance ),
-    FUNCDATA( Oddlprice,        UNIQUE,     INTPAR,     8,          FDCat_Finance ),
-    FUNCDATA( Oddlyield,        UNIQUE,     INTPAR,     8,          FDCat_Finance ),
-    FUNCDATA( Xirr,             UNIQUE,     INTPAR,     3,          FDCat_Finance ),
-    FUNCDATA( Xnpv,             UNIQUE,     STDPAR,     3,          FDCat_Finance ),
-    FUNCDATA( Intrate,          UNIQUE,     INTPAR,     5,          FDCat_Finance ),
-    FUNCDATA( Coupncd,          UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Coupdays,         UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Coupdaysnc,       UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Coupdaybs,        UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Couppcd,          UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Coupnum,          UNIQUE,     INTPAR,     4,          FDCat_Finance ),
-    FUNCDATA( Fvschedule,       UNIQUE,     STDPAR,     2,          FDCat_Finance )
+    FUNCDATA( Workday,          UNIQUE,     INTPAR,     3,          FDCategory::DateTime ),
+    FUNCDATA( Yearfrac,         UNIQUE,     INTPAR,     3,          FDCategory::DateTime ),
+    FUNCDATA( Edate,            UNIQUE,     INTPAR,     2,          FDCategory::DateTime ),
+    FUNCDATAS( Weeknum,         DOUBLE,     INTPAR,     2,          FDCategory::DateTime, "_EXCEL2003" ),
+    FUNCDATA( Eomonth,          UNIQUE,     INTPAR,     2,          FDCategory::DateTime ),
+    FUNCDATAS( Networkdays,     DOUBLE,     INTPAR,     3,          FDCategory::DateTime, "_EXCEL2003" ),
+    FUNCDATA( Iseven,           DOUBLE,     STDPAR,     1,          FDCategory::Inf ),
+    FUNCDATA( Isodd,            DOUBLE,     STDPAR,     1,          FDCategory::Inf ),
+    FUNCDATA( Multinomial,      UNIQUE,     STDPAR,     1,          FDCategory::Math ),
+    FUNCDATA( Seriessum,        UNIQUE,     STDPAR,     4,          FDCategory::Math ),
+    FUNCDATA( Quotient,         UNIQUE,     STDPAR,     2,          FDCategory::Math ),
+    FUNCDATA( Mround,           UNIQUE,     STDPAR,     2,          FDCategory::Math ),
+    FUNCDATA( Sqrtpi,           UNIQUE,     STDPAR,     1,          FDCategory::Math ),
+    FUNCDATA( Randbetween,      UNIQUE,     STDPAR,     2,          FDCategory::Math ),
+    FUNCDATAS( Gcd,             DOUBLE,     INTPAR,     1,          FDCategory::Math, "_EXCEL2003" ),
+    FUNCDATAS( Lcm,             DOUBLE,     INTPAR,     1,          FDCategory::Math, "_EXCEL2003" ),
+    FUNCDATA( Besseli,          UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Besselj,          UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Besselk,          UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Bessely,          UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Bin2Oct,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Bin2Dec,          UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Bin2Hex,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Oct2Bin,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Oct2Dec,          UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Oct2Hex,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Dec2Bin,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Dec2Hex,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Dec2Oct,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Hex2Bin,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Hex2Dec,          UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Hex2Oct,          UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Delta,            UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Erf,              UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Erfc,             UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Gestep,           UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Factdouble,       UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imabs,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imaginary,        UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Impower,          UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Imargument,       UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imcos,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imdiv,            UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Imexp,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imconjugate,      UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imln,             UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imlog10,          UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imlog2,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Improduct,        UNIQUE,     INTPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Imreal,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsin,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsub,            UNIQUE,     STDPAR,     2,          FDCategory::Tech ),
+    FUNCDATA( Imsqrt,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsum,            UNIQUE,     INTPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imtan,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsec,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imcsc,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imcot,            UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsinh,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imcosh,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imsech,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Imcsch,           UNIQUE,     STDPAR,     1,          FDCategory::Tech ),
+    FUNCDATA( Complex,          UNIQUE,     STDPAR,     3,          FDCategory::Tech ),
+    FUNCDATA( Convert,          UNIQUE,     STDPAR,     3,          FDCategory::Tech ),
+    FUNCDATA( Amordegrc,        UNIQUE,     INTPAR,     7,          FDCategory::Finance ),
+    FUNCDATA( Amorlinc,         UNIQUE,     INTPAR,     7,          FDCategory::Finance ),
+    FUNCDATA( Accrint,          UNIQUE,     INTPAR,     7,          FDCategory::Finance ),
+    FUNCDATA( Accrintm,         UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Received,         UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Disc,             UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Duration,         UNIQUE,     INTPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Effect,           DOUBLE,     STDPAR,     2,          FDCategory::Finance ),
+    FUNCDATA( Cumprinc,         DOUBLE,     STDPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Cumipmt,          DOUBLE,     STDPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Price,            UNIQUE,     INTPAR,     7,          FDCategory::Finance ),
+    FUNCDATA( Pricedisc,        UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Pricemat,         UNIQUE,     INTPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Mduration,        UNIQUE,     INTPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Nominal,          DOUBLE,     STDPAR,     2,          FDCategory::Finance ),
+    FUNCDATA( Dollarfr,         UNIQUE,     STDPAR,     2,          FDCategory::Finance ),
+    FUNCDATA( Dollarde,         UNIQUE,     STDPAR,     2,          FDCategory::Finance ),
+    FUNCDATA( Yield,            UNIQUE,     INTPAR,     7,          FDCategory::Finance ),
+    FUNCDATA( Yielddisc,        UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Yieldmat,         UNIQUE,     INTPAR,     6,          FDCategory::Finance ),
+    FUNCDATA( Tbilleq,          UNIQUE,     INTPAR,     3,          FDCategory::Finance ),
+    FUNCDATA( Tbillprice,       UNIQUE,     INTPAR,     3,          FDCategory::Finance ),
+    FUNCDATA( Tbillyield,       UNIQUE,     INTPAR,     3,          FDCategory::Finance ),
+    FUNCDATA( Oddfprice,        UNIQUE,     INTPAR,     9,          FDCategory::Finance ),
+    FUNCDATA( Oddfyield,        UNIQUE,     INTPAR,     9,          FDCategory::Finance ),
+    FUNCDATA( Oddlprice,        UNIQUE,     INTPAR,     8,          FDCategory::Finance ),
+    FUNCDATA( Oddlyield,        UNIQUE,     INTPAR,     8,          FDCategory::Finance ),
+    FUNCDATA( Xirr,             UNIQUE,     INTPAR,     3,          FDCategory::Finance ),
+    FUNCDATA( Xnpv,             UNIQUE,     STDPAR,     3,          FDCategory::Finance ),
+    FUNCDATA( Intrate,          UNIQUE,     INTPAR,     5,          FDCategory::Finance ),
+    FUNCDATA( Coupncd,          UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Coupdays,         UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Coupdaysnc,       UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Coupdaybs,        UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Couppcd,          UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Coupnum,          UNIQUE,     INTPAR,     4,          FDCategory::Finance ),
+    FUNCDATA( Fvschedule,       UNIQUE,     STDPAR,     2,          FDCategory::Finance )
 };
 #undef FUNCDATA
 
diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx
index b00654d..670f5c5 100644
--- a/scaddins/source/analysis/analysishelper.hxx
+++ b/scaddins/source/analysis/analysishelper.hxx
@@ -188,14 +188,13 @@ double              GetCoupdays( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int
                                 sal_Int32 nBase );
 
 
-enum FDCategory
-{
-    FDCat_AddIn,
-    FDCat_DateTime,
-    FDCat_Finance,
-    FDCat_Inf,
-    FDCat_Math,
-    FDCat_Tech
+enum class FDCategory
+{
+    DateTime,
+    Finance,
+    Inf,
+    Math,
+    Tech
 };
 
 
@@ -204,8 +203,8 @@ struct FuncDataBase
     const sal_Char*         pIntName;
     sal_uInt16              nUINameID;          // resource ID to UI name
     sal_uInt16              nDescrID;           // resource ID to description, parameter names and ~ description
-    bool                bDouble;            // name already exist in Calc
-    bool                bWithOpt;           // first parameter is internal
+    bool                    bDouble;            // name already exist in Calc
+    bool                    bWithOpt;           // first parameter is internal
     sal_uInt16              nCompListID;        // resource ID to list of valid names
     sal_uInt16              nNumOfParams;       // number of named / described parameters
     FDCategory              eCat;               // function category
@@ -216,15 +215,15 @@ struct FuncDataBase
 class FuncData final
 {
 private:
-    OUString         aIntName;
+    OUString                aIntName;
     sal_uInt16              nUINameID;
     sal_uInt16              nDescrID;           // leads also to parameter descriptions!
-    bool                bDouble;            // flag for names that already exist in Calc
-    bool                bWithOpt;           // has internal parameter on first position
+    bool                    bDouble;            // flag for names that already exist in Calc
+    bool                    bWithOpt;           // has internal parameter on first position
 
     sal_uInt16              nParam;             // num of parameters
     sal_uInt16              nCompID;
-    std::vector<OUString>  aCompList;          // list of all valid names
+    std::vector<OUString>   aCompList;          // list of all valid names
     FDCategory              eCat;               // function category
     OUString                aSuffix;            // if bDouble and not empty, append a suffix other than "_ADD" for UI
 


More information about the Libreoffice-commits mailing list