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

Winfried Donkers winfrieddonkers at libreoffice.org
Fri Nov 22 03:38:01 PST 2013


 formula/source/core/resource/core_resource.src |   28 +++
 include/formula/compiler.hrc                   |    6 
 include/formula/opcode.hxx                     |    4 
 sc/inc/helpids.h                               |    4 
 sc/qa/unit/ucalc.cxx                           |    4 
 sc/source/core/inc/interpre.hxx                |    2 
 sc/source/core/tool/interpr3.cxx               |   69 ++++++++-
 sc/source/core/tool/interpr4.cxx               |   10 -
 sc/source/filter/excel/xlformula.cxx           |   48 +++---
 sc/source/filter/oox/formulabase.cxx           |    6 
 sc/source/ui/src/scfuncs.src                   |  184 +++++++++++++++++++++++++
 11 files changed, 328 insertions(+), 37 deletions(-)

New commits:
commit e434c1ce0557454ef4cdd98435c5c0b1d5181bcf
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date:   Thu Nov 21 11:16:43 2013 +0100

    fdo#71722 add Excel 2010 functions
    
    EXPON.DIST, HYPGEOM.DIST, POISSON.DIST, WEIBULL.DIST
    
    Change-Id: Ib9f648739ec0af90cdf2f576c7f548a6acb7b4a6
    Reviewed-on: https://gerrit.libreoffice.org/6748
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index 609928b..afb1d15 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -195,9 +195,11 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_B { Text = "BINOM.DIST.RANGE" ; };
     String SC_OPCODE_NORM_DIST { Text = "NORMDIST" ; };
     String SC_OPCODE_EXP_DIST { Text = "EXPONDIST" ; };
+    String SC_OPCODE_EXP_DIST_MS { Text = "COM.MICROSOFT.EXPON.DIST" ; };
     String SC_OPCODE_BINOM_DIST { Text = "BINOMDIST" ; };
     String SC_OPCODE_BINOM_DIST_MS { Text = "COM.MICROSOFT.BINOM.DIST" ; };
     String SC_OPCODE_POISSON_DIST { Text = "POISSON" ; };
+    String SC_OPCODE_POISSON_DIST_MS { Text = "COM.MICROSOFT.POISSON.DIST" ; };
     String SC_OPCODE_KOMBIN { Text = "COMBIN" ; };
     String SC_OPCODE_KOMBIN_2 { Text = "COMBINA" ; };
     String SC_OPCODE_VARIATIONEN { Text = "PERMUT" ; };
@@ -281,6 +283,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_MATRIX_UNIT { Text = "MUNIT" ; };
     String SC_OPCODE_BACK_SOLVER { Text = "GOALSEEK" ; };
     String SC_OPCODE_HYP_GEOM_DIST { Text = "HYPGEOMDIST" ; };
+    String SC_OPCODE_HYP_GEOM_DIST_MS { Text = "COM.MICROSOFT.HYPGEOM.DIST" ; };
     String SC_OPCODE_LOG_NORM_DIST { Text = "LOGNORMDIST" ; };
     String SC_OPCODE_T_DIST { Text = "LEGACY.TDIST" ; };
     String SC_OPCODE_F_DIST { Text = "LEGACY.FDIST" ; };
@@ -289,6 +292,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_CHI_DIST { Text = "LEGACY.CHIDIST" ; };
     String SC_OPCODE_CHI_DIST_MS { Text = "COM.MICROSOFT.CHISQ.DIST.RT" ; };
     String SC_OPCODE_WEIBULL { Text = "WEIBULL" ; };
+    String SC_OPCODE_WEIBULL_MS { Text = "COM.MICROSOFT.WEIBULL.DIST" ; };
     String SC_OPCODE_NEG_BINOM_VERT { Text = "NEGBINOMDIST" ; };
     String SC_OPCODE_KRIT_BINOM { Text = "CRITBINOM" ; };
     String SC_OPCODE_BINOM_INV { Text = "COM.MICROSOFT.BINOM.INV" ; };
@@ -563,9 +567,11 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
     String SC_OPCODE_B { Text = "B" ; };
     String SC_OPCODE_NORM_DIST { Text = "NORMDIST" ; };
     String SC_OPCODE_EXP_DIST { Text = "EXPONDIST" ; };
+    String SC_OPCODE_EXP_DIST_MS { Text = "_xlfn.EXPON.DIST" ; };
     String SC_OPCODE_BINOM_DIST { Text = "BINOMDIST" ; };
     String SC_OPCODE_BINOM_DIST_MS { Text = "_xlfn.BINOM.DIST" ; };
     String SC_OPCODE_POISSON_DIST { Text = "POISSON" ; };
+    String SC_OPCODE_POISSON_DIST_MS { Text = "_xlfn.POISSON.DIST" ; };
     String SC_OPCODE_KOMBIN { Text = "COMBIN" ; };
     String SC_OPCODE_KOMBIN_2 { Text = "_xlfn.COMBINA" ; };
     String SC_OPCODE_VARIATIONEN { Text = "PERMUT" ; };
@@ -649,6 +655,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
     String SC_OPCODE_MATRIX_UNIT { Text = "_xlfn.MUNIT" ; };
     String SC_OPCODE_BACK_SOLVER { Text = "GOALSEEK" ; };
     String SC_OPCODE_HYP_GEOM_DIST { Text = "HYPGEOMDIST" ; };
+    String SC_OPCODE_HYP_GEOM_DIST_MS { Text = "_xlfn.HYPGEOM.DIST" ; };
     String SC_OPCODE_LOG_NORM_DIST { Text = "LOGNORMDIST" ; };
     String SC_OPCODE_T_DIST { Text = "TDIST" ; };
     String SC_OPCODE_F_DIST { Text = "FDIST" ; };
@@ -657,6 +664,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_OOXML
     String SC_OPCODE_CHI_DIST { Text = "CHIDIST" ; };
     String SC_OPCODE_CHI_DIST_MS { Text = "_xlfn.CHISQ.DIST.RT" ; };
     String SC_OPCODE_WEIBULL { Text = "WEIBULL" ; };
+    String SC_OPCODE_WEIBULL_MS { Text = "_xlfn.WEIBULL.DIST" ; };
     String SC_OPCODE_NEG_BINOM_VERT { Text = "NEGBINOMDIST" ; };
     String SC_OPCODE_KRIT_BINOM { Text = "CRITBINOM" ; };
     String SC_OPCODE_BINOM_INV { Text = "_xlfn.BINOM.INV" ; };
@@ -933,9 +941,11 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_B { Text = "B" ; };
     String SC_OPCODE_NORM_DIST { Text = "NORMDIST" ; };
     String SC_OPCODE_EXP_DIST { Text = "EXPONDIST" ; };
+    String SC_OPCODE_EXP_DIST_MS { Text = "EXPON.DIST" ; };
     String SC_OPCODE_BINOM_DIST { Text = "BINOMDIST" ; };
     String SC_OPCODE_BINOM_DIST_MS { Text = "BINOM.DIST" ; };
     String SC_OPCODE_POISSON_DIST { Text = "POISSON" ; };
+    String SC_OPCODE_POISSON_DIST_MS { Text = "POISSON.DIST" ; };
     String SC_OPCODE_KOMBIN { Text = "COMBIN" ; };
     String SC_OPCODE_KOMBIN_2 { Text = "COMBINA" ; };
     String SC_OPCODE_VARIATIONEN { Text = "PERMUT" ; };
@@ -1019,6 +1029,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_MATRIX_UNIT { Text = "MUNIT" ; };
     String SC_OPCODE_BACK_SOLVER { Text = "GOALSEEK" ; };
     String SC_OPCODE_HYP_GEOM_DIST { Text = "HYPGEOMDIST" ; };
+    String SC_OPCODE_HYP_GEOM_DIST_MS { Text = "HYPGEOM.DIST" ; };
     String SC_OPCODE_LOG_NORM_DIST { Text = "LOGNORMDIST" ; };
     String SC_OPCODE_T_DIST { Text = "TDIST" ; };
     String SC_OPCODE_F_DIST { Text = "FDIST" ; };
@@ -1027,6 +1038,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH
     String SC_OPCODE_CHI_DIST { Text = "CHIDIST" ; };
     String SC_OPCODE_CHI_DIST_MS { Text = "CHISQ.DIST.RT" ; };
     String SC_OPCODE_WEIBULL { Text = "WEIBULL" ; };
+    String SC_OPCODE_WEIBULL_MS { Text = "WEIBULL.DIST" ; };
     String SC_OPCODE_NEG_BINOM_VERT { Text = "NEGBINOMDIST" ; };
     String SC_OPCODE_KRIT_BINOM { Text = "CRITBINOM" ; };
     String SC_OPCODE_BINOM_INV { Text = "BINOM.INV" ; };
@@ -1743,6 +1755,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "EXPONDIST" ;
     };
+    String SC_OPCODE_EXP_DIST_MS
+    {
+        Text [ en-US ] = "EXPON.DIST" ;
+    };
     String SC_OPCODE_BINOM_DIST
     {
         Text [ en-US ] = "BINOMDIST" ;
@@ -1755,6 +1771,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "POISSON" ;
     };
+    String SC_OPCODE_POISSON_DIST_MS
+    {
+        Text [ en-US ] = "POISSON.DIST" ;
+    };
     String SC_OPCODE_KOMBIN
     {
         Text [ en-US ] = "COMBIN" ;
@@ -2088,6 +2108,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "HYPGEOMDIST" ;
     };
+    String SC_OPCODE_HYP_GEOM_DIST_MS
+    {
+        Text [ en-US ] = "HYPGEOM.DIST" ;
+    };
     String SC_OPCODE_LOG_NORM_DIST
     {
         Text [ en-US ] = "LOGNORMDIST" ;
@@ -2120,6 +2144,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "WEIBULL" ;
     };
+    String SC_OPCODE_WEIBULL_MS
+    {
+        Text [ en-US ] = "WEIBULL.DIST" ;
+    };
     String SC_OPCODE_NEG_BINOM_VERT
     {
         Text [ en-US ] = "NEGBINOMDIST" ;
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index 4f2f4e6..9bda945 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -430,8 +430,12 @@
 #define SC_OPCODE_F_INV_LT          432
 #define SC_OPCODE_F_INV_RT          433
 #define SC_OPCODE_F_TEST_MS         434
+#define SC_OPCODE_EXP_DIST_MS       435
+#define SC_OPCODE_HYP_GEOM_DIST_MS  436
+#define SC_OPCODE_POISSON_DIST_MS   437
+#define SC_OPCODE_WEIBULL_MS        438
 
-#define SC_OPCODE_STOP_2_PAR        435     /* last function with two or more parameters' OpCode + 1 */
+#define SC_OPCODE_STOP_2_PAR        439     /* last function with two or more parameters' OpCode + 1 */
 #define SC_OPCODE_STOP_FUNCTION     SC_OPCODE_STOP_2_PAR            /* last function's OpCode + 1 */
 #define SC_OPCODE_LAST_OPCODE_ID    (SC_OPCODE_STOP_FUNCTION - 1)   /* last OpCode */
 
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index b5953f7..58f3d41 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -229,10 +229,12 @@ enum OpCodeEnum
         ocB                 = SC_OPCODE_B,
         ocNormDist          = SC_OPCODE_NORM_DIST,
         ocExpDist           = SC_OPCODE_EXP_DIST,
+        ocExpDist_MS        = SC_OPCODE_EXP_DIST_MS,
         ocBinomDist         = SC_OPCODE_BINOM_DIST,
         ocBinomDist_MS      = SC_OPCODE_BINOM_DIST_MS,
         ocBinomInv          = SC_OPCODE_BINOM_INV,
         ocPoissonDist       = SC_OPCODE_POISSON_DIST,
+        ocPoissonDist_MS    = SC_OPCODE_POISSON_DIST_MS,
         ocKombin            = SC_OPCODE_KOMBIN,
         ocKombin2           = SC_OPCODE_KOMBIN_2,
         ocVariationen       = SC_OPCODE_VARIATIONEN,
@@ -323,6 +325,7 @@ enum OpCodeEnum
         ocBackSolver        = SC_OPCODE_BACK_SOLVER,
     // Statistical functions
         ocHypGeomDist       = SC_OPCODE_HYP_GEOM_DIST,
+        ocHypGeomDist_MS    = SC_OPCODE_HYP_GEOM_DIST_MS,
         ocLogNormDist       = SC_OPCODE_LOG_NORM_DIST,
         ocTDist             = SC_OPCODE_T_DIST,
         ocFDist             = SC_OPCODE_F_DIST,
@@ -335,6 +338,7 @@ enum OpCodeEnum
         ocChiSqInv          = SC_OPCODE_CHISQ_INV,
         ocChiSqInv_MS       = SC_OPCODE_CHISQ_INV_MS,
         ocWeibull           = SC_OPCODE_WEIBULL,
+        ocWeibull_MS        = SC_OPCODE_WEIBULL_MS,
         ocNegBinomVert      = SC_OPCODE_NEG_BINOM_VERT,
         ocKritBinom         = SC_OPCODE_KRIT_BINOM,
         ocKurt              = SC_OPCODE_KURT,
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 5547551..e1c2dac 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -700,5 +700,9 @@
 #define HID_FUNC_F_INV_LT                                       "SC_HID_FUNC_F_INV_LT"
 #define HID_FUNC_F_INV_RT                                       "SC_HID_FUNC_F_INV_RT"
 #define HID_FUNC_F_TEST_MS                                      "SC_HID_FUNC_F_TEST_MS"
+#define HID_FUNC_EXP_DIST_MS                                    "SC_HID_FUNC_EXP_DIST_MS"
+#define HID_FUNC_HYP_GEOM_DIST_MS                               "SC_HID_FUNC_HYP_GEOM_DIST_MS"
+#define HID_FUNC_POISSON_DIST_MS                                "SC_HID_FUNC_POISSON_DIST_MS"
+#define HID_FUNC_WEIBULL_DIST_MS                                "SC_HID_FUNC_WEIBULL_DIST_MS"
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8d30157..97a8d70 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2388,6 +2388,7 @@ void Test::testFunctionLists()
         "COVARIANCE.S",
         "CRITBINOM",
         "DEVSQ",
+        "EXPON.DIST",
         "EXPONDIST",
         "F.DIST",
         "F.DIST.RT",
@@ -2407,6 +2408,7 @@ void Test::testFunctionLists()
         "GAUSS",
         "GEOMEAN",
         "HARMEAN",
+        "HYPGEOM.DIST",
         "HYPGEOMDIST",
         "INTERCEPT",
         "KURT",
@@ -2431,6 +2433,7 @@ void Test::testFunctionLists()
         "PERMUTATIONA",
         "PHI",
         "POISSON",
+        "POISSON.DIST",
         "PROB",
         "QUARTILE",
         "RANK",
@@ -2458,6 +2461,7 @@ void Test::testFunctionLists()
         "VARP",
         "VARPA",
         "WEIBULL",
+        "WEIBULL.DIST",
         "ZTEST",
         0
     };
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index dc8c8b4..e8eefa3 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -725,6 +725,7 @@ double GetLogGamma(double x);
 double GetBeta(double fAlpha, double fBeta);
 double GetLogBeta(double fAlpha, double fBeta);
 double GetBinomDistPMF(double x, double n, double p); //probability mass function
+double GetHypGeomDist( double x, double n, double M, double N );
 void ScLogGamma();
 void ScGamma();
 void ScPhi();
@@ -745,6 +746,7 @@ void ScVariationen();
 void ScVariationen2();
 void ScB();
 void ScHypGeomDist();
+void ScHypGeomDist_MS();
 void ScLogNormDist();
 void ScLogNormInv();
 void ScTDist();
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 515530b..0cb0cc8 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -1738,12 +1738,6 @@ static void lcl_PutFactorialElements( ::std::vector< double >& cn, double fLower
 
 /** Calculates a value of the hypergeometric distribution.
 
-    The algorithm is designed to avoid unnecessary multiplications and division
-    by expanding all factorial elements (9 of them).  It is done by excluding
-    those ranges that overlap in the numerator and the denominator.  This allows
-    for a fast calculation for large values which would otherwise cause an overflow
-    in the intermediate values.
-
     @author Kohei Yoshida <kohei at openoffice.org>
 
     @see #i47296#
@@ -1751,8 +1745,6 @@ static void lcl_PutFactorialElements( ::std::vector< double >& cn, double fLower
  */
 void ScInterpreter::ScHypGeomDist()
 {
-    const size_t nMaxArraySize = 500000; // arbitrary max array size
-
     if ( !MustHaveParamCount( GetByte(), 4 ) )
         return;
 
@@ -1767,6 +1759,63 @@ void ScInterpreter::ScHypGeomDist()
         return;
     }
 
+    PushDouble( GetHypGeomDist( x, n, M, N ) );
+}
+
+/** Calculates a value of the hypergeometric distribution (Excel 2010 function).
+
+    This function has an extra argument bCumulative as compared to ScHypGeomDist(),
+    which only calculates the non-cumulative distribution.
+
+    @see fdo#71722
+*/
+void ScInterpreter::ScHypGeomDist_MS()
+{
+    if ( !MustHaveParamCount( GetByte(), 5 ) )
+        return;
+
+    bool bCumulative = GetBool();
+    double N = ::rtl::math::approxFloor(GetDouble());
+    double M = ::rtl::math::approxFloor(GetDouble());
+    double n = ::rtl::math::approxFloor(GetDouble());
+    double x = ::rtl::math::approxFloor(GetDouble());
+
+    if( (x < 0.0) || (n < x) || (M < x) || (N < n) || (N < M) || (x < n - N + M) )
+    {
+        PushIllegalArgument();
+        return;
+    }
+
+    if ( bCumulative )
+    {
+        double fVal = 0.0;
+
+        for ( int i = 0; i <= x && !nGlobalError; i++ )
+            fVal += GetHypGeomDist( i, n, M, N );
+
+        PushDouble( fVal );
+    }
+    else
+        PushDouble( GetHypGeomDist( x, n, M, N ) );
+}
+
+/** Calculates a value of the hypergeometric distribution.
+
+    The algorithm is designed to avoid unnecessary multiplications and division
+    by expanding all factorial elements (9 of them).  It is done by excluding
+    those ranges that overlap in the numerator and the denominator.  This allows
+    for a fast calculation for large values which would otherwise cause an overflow
+    in the intermediate values.
+
+    @author Kohei Yoshida <kohei at openoffice.org>
+
+    @see #i47296#
+
+ */
+double ScInterpreter::GetHypGeomDist( double x, double n, double M, double N )
+{
+    const size_t nMaxArraySize = 500000; // arbitrary max array size
+
     typedef ::std::vector< double > HypContainer;
     HypContainer cnNumer, cnDenom;
 
@@ -1775,7 +1824,7 @@ void ScInterpreter::ScHypGeomDist()
     if ( nEstContainerSize > nMaxSize )
     {
         PushNoValue();
-        return;
+        return 0;
     }
     cnNumer.reserve( nEstContainerSize + 10 );
     cnDenom.reserve( nEstContainerSize + 10 );
@@ -1959,7 +2008,7 @@ void ScInterpreter::ScHypGeomDist()
         fFactor *= fEnum / fDenom;
     }
 
-    PushDouble(fFactor);
+    return fFactor;
 }
 
 void ScInterpreter::ScGammaDist()
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 38d73b0..d230ac8 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4099,15 +4099,18 @@ StackVar ScInterpreter::Interpret()
                 case ocMatRef           : ScMatRef();                   break;
                 case ocB                : ScB();                        break;
                 case ocNormDist         : ScNormDist();                 break;
-                case ocExpDist          : ScExpDist();                  break;
+                case ocExpDist          :
+                case ocExpDist_MS       : ScExpDist();                  break;
                 case ocBinomDist        :
                 case ocBinomDist_MS     : ScBinomDist();                break;
-                case ocPoissonDist      : ScPoissonDist();              break;
+                case ocPoissonDist      :
+                case ocPoissonDist_MS   : ScPoissonDist();              break;
                 case ocKombin           : ScKombin();                   break;
                 case ocKombin2          : ScKombin2();                  break;
                 case ocVariationen      : ScVariationen();              break;
                 case ocVariationen2     : ScVariationen2();             break;
                 case ocHypGeomDist      : ScHypGeomDist();              break;
+                case ocHypGeomDist_MS   : ScHypGeomDist_MS();           break;
                 case ocLogNormDist      : ScLogNormDist();              break;
                 case ocTDist            : ScTDist();                    break;
                 case ocFDist            :
@@ -4127,7 +4130,8 @@ StackVar ScInterpreter::Interpret()
                 case ocMedian           : ScMedian();                   break;
                 case ocGeoMean          : ScGeoMean();                  break;
                 case ocHarMean          : ScHarMean();                  break;
-                case ocWeibull          : ScWeibull();                  break;
+                case ocWeibull          :
+                case ocWeibull_MS       : ScWeibull();                  break;
                 case ocBinomInv         :
                 case ocKritBinom        : ScCritBinom();                break;
                 case ocNegBinomVert     : ScNegBinomDist();             break;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index b525d75..67d21ee 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -429,28 +429,32 @@ static const XclFunctionInfo saFuncTable_Oox[] =
  */
 static const XclFunctionInfo saFuncTable_2010[] =
 {
-    EXC_FUNCENTRY_V_VA(         ocCovarianceP,   2,  2,  0,  "COVARIANCE.P" ),
-    EXC_FUNCENTRY_V_VA(         ocCovarianceS,   2,  2,  0,  "COVARIANCE.S" ),
-    EXC_FUNCENTRY_V_RX(         ocStDevP_MS,     1, MX,  0,  "STDEV.P" ),
-    EXC_FUNCENTRY_V_RX(         ocStDevS,        1, MX,  0,  "STDEV.S" ),
-    EXC_FUNCENTRY_V_RX(         ocVarP_MS,       1, MX,  0,  "VAR.P" ),
-    EXC_FUNCENTRY_V_RX(         ocVarS,          1, MX,  0,  "VAR.S" ),
-    EXC_FUNCENTRY_V_VR(         ocBetaDist_MS,   4,  6,  0,  "BETA.DIST" ),
-    EXC_FUNCENTRY_V_VR(         ocBetaInv_MS,    3,  5,  0,  "BETA.INV" ),
-    EXC_FUNCENTRY_V_VR(         ocBinomDist_MS,  4,  4,  0,  "BINOM.DIST" ),
-    EXC_FUNCENTRY_V_VR(         ocBinomInv,      3,  3,  0,  "BINOM.INV" ),
-    EXC_FUNCENTRY_V_VR(         ocChiSqDist_MS,  3,  3,  0,  "CHISQ.DIST" ),
-    EXC_FUNCENTRY_V_VR(         ocChiSqInv_MS,   2,  2,  0,  "CHISQ.INV" ),
-    EXC_FUNCENTRY_V_VR(         ocChiDist_MS,    2,  2,  0,  "CHISQ.DIST.RT" ),
-    EXC_FUNCENTRY_V_VR(         ocChiInv_MS,     2,  2,  0,  "CHISQ.INV.RT" ),
-    EXC_FUNCENTRY_V_VR(         ocChiTest_MS,    2,  2,  0,  "CHISQ.TEST" ),
-    EXC_FUNCENTRY_V_VR(         ocConfidence_N,  3,  3,  0,  "CONFIDENCE.NORM" ),
-    EXC_FUNCENTRY_V_VR(         ocConfidence_T,  3,  3,  0,  "CONFIDENCE.T" ),
-    EXC_FUNCENTRY_V_VR(         ocFDist_LT,      4,  4,  0,  "F.DIST" ),
-    EXC_FUNCENTRY_V_VR(         ocFDist_RT,      3,  3,  0,  "F.DIST.RT" ),
-    EXC_FUNCENTRY_V_VR(         ocFInv_LT,       3,  3,  0,  "F.INV" ),
-    EXC_FUNCENTRY_V_VR(         ocFInv_RT,       3,  3,  0,  "F.INV.RT" ),
-    EXC_FUNCENTRY_V_VR(         ocFTest_MS,      2,  2,  0,  "F.TEST" )
+    EXC_FUNCENTRY_V_VA(         ocCovarianceP,    2,  2,  0,  "COVARIANCE.P" ),
+    EXC_FUNCENTRY_V_VA(         ocCovarianceS,    2,  2,  0,  "COVARIANCE.S" ),
+    EXC_FUNCENTRY_V_RX(         ocStDevP_MS,      1, MX,  0,  "STDEV.P" ),
+    EXC_FUNCENTRY_V_RX(         ocStDevS,         1, MX,  0,  "STDEV.S" ),
+    EXC_FUNCENTRY_V_RX(         ocVarP_MS,        1, MX,  0,  "VAR.P" ),
+    EXC_FUNCENTRY_V_RX(         ocVarS,           1, MX,  0,  "VAR.S" ),
+    EXC_FUNCENTRY_V_VR(         ocBetaDist_MS,    4,  6,  0,  "BETA.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocBetaInv_MS,     3,  5,  0,  "BETA.INV" ),
+    EXC_FUNCENTRY_V_VR(         ocBinomDist_MS,   4,  4,  0,  "BINOM.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocBinomInv,       3,  3,  0,  "BINOM.INV" ),
+    EXC_FUNCENTRY_V_VR(         ocChiSqDist_MS,   3,  3,  0,  "CHISQ.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocChiSqInv_MS,    2,  2,  0,  "CHISQ.INV" ),
+    EXC_FUNCENTRY_V_VR(         ocChiDist_MS,     2,  2,  0,  "CHISQ.DIST.RT" ),
+    EXC_FUNCENTRY_V_VR(         ocChiInv_MS,      2,  2,  0,  "CHISQ.INV.RT" ),
+    EXC_FUNCENTRY_V_VR(         ocChiTest_MS,     2,  2,  0,  "CHISQ.TEST" ),
+    EXC_FUNCENTRY_V_VR(         ocConfidence_N,   3,  3,  0,  "CONFIDENCE.NORM" ),
+    EXC_FUNCENTRY_V_VR(         ocConfidence_T,   3,  3,  0,  "CONFIDENCE.T" ),
+    EXC_FUNCENTRY_V_VR(         ocFDist_LT,       4,  4,  0,  "F.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocFDist_RT,       3,  3,  0,  "F.DIST.RT" ),
+    EXC_FUNCENTRY_V_VR(         ocFInv_LT,        3,  3,  0,  "F.INV" ),
+    EXC_FUNCENTRY_V_VR(         ocFInv_RT,        3,  3,  0,  "F.INV.RT" ),
+    EXC_FUNCENTRY_V_VR(         ocFTest_MS,       2,  2,  0,  "F.TEST" ),
+    EXC_FUNCENTRY_V_VR(         ocExpDist_MS,     3,  3,  0,  "EXPON.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocHypGeomDist_MS, 5,  5,  0,  "HYPGEOM.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocPoissonDist_MS, 3,  3,  0,  "POISSON.DIST" ),
+    EXC_FUNCENTRY_V_VR(         ocWeibull_MS,     4,  4,  0,  "WEIBULL.DIST" )
 };
 
 /** Functions new in Excel 2013.
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index b2376f4..ef8c926 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -768,7 +768,11 @@ static const FunctionData saFuncTable2010[] =
     { "COM.MICROSOFT.F.DIST.RT",              "F.DIST.RT",           NOID,   NOID,    3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
     { "COM.MICROSOFT.F.INV",                  "F.INV",               NOID,   NOID,    3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
     { "COM.MICROSOFT.F.INV.RT",               "F.INV.RT",            NOID,   NOID,    3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
-    { "COM.MICROSOFT.F.TEST",                 "F.TEST",              NOID,   NOID,    2,  2,  V, { VA }, FUNCFLAG_MACROCALL_NEW }
+    { "COM.MICROSOFT.F.TEST",                 "F.TEST",              NOID,   NOID,    2,  2,  V, { VA }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.EXPON.DIST",             "EXPON.DIST",          NOID,   NOID,    3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.HYPGEOM.DIST",           "HYPGEOM.DIST",        NOID,   NOID,    5,  5,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.POISSON.DIST",           "POISSON.DIST",        NOID,   NOID,    3,  3,  V, { VR }, FUNCFLAG_MACROCALL_NEW },
+    { "COM.MICROSOFT.WEIBULL.DIST",           "WEIBULL.DIST",        NOID,   NOID,    4,  4,  V, { VR }, FUNCFLAG_MACROCALL_NEW }
 };
 
 /** Functions new in Excel 2013.
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 36dee21..ba670a4 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -6295,6 +6295,46 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "0 or FALSE calculates the probability density function. Any other value or TRUE or omitted calculates the cumulative distribution function." ;
         };
     };
+     // -=*# Resource for function POISSON.DIST #*=-
+    Resource SC_OPCODE_POISSON_DIST_MS
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Returns the Poisson distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_POISSON_DIST_MS );
+            3;  0;  0;  1;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "Number" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The value for which the Poisson distribution is to be calculated." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "mean" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "Mean. The mean value of the Poisson distribution." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "Cumulative" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "0 or FALSE calculates the probability density function. Any other value or TRUE or omitted calculates the cumulative distribution function." ;
+        };
+    };
      // -=*# Resource for function NORMVERT #*=-
     Resource SC_OPCODE_NORM_DIST
     {
@@ -6559,6 +6599,46 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "Cumulated. C=0 calculates the density function, C=1 the distribution." ;
         };
     };
+     // -=*# Resource for function EXPON.DIST #*=-
+    Resource SC_OPCODE_EXP_DIST_MS
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Values of the exponential distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_EXP_DIST_MS );
+            3;  0;  0;  0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "Number" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The value to which the exponential distribution is to be calculated." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "lambda" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "The parameters of the exponential distribution." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "C" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "Cumulated. C=0 calculates the density function, C=1 the distribution." ;
+        };
+    };
      // -=*# Resource for function GAMMAVERT #*=-
     Resource SC_OPCODE_GAMMA_DIST
     {
@@ -6985,6 +7065,54 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "Cumulated. C=0 calculates the density function, C=1 the distribution." ;
         };
     };
+     // -=*# Resource for function WEIBULL.DIST #*=-
+    Resource SC_OPCODE_WEIBULL_MS
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Returns the values of the Weibull distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_WEIBULL_DIST_MS );
+            4;  0;  0;  0;  0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "Number" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The value for which the Weibull distribution is to be calculated." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "Alpha" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "The Alpha parameter of the Weibull distribution." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "beta" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "The Beta parameter of the Weibull distribution." ;
+        };
+        String 8 // Name of Parameter 4
+        {
+            Text [ en-US ] = "C" ;
+        };
+        String 9 // Description of Parameter 4
+        {
+            Text [ en-US ] = "Cumulated. C=0 calculates the density function, C=1 the distribution." ;
+        };
+    };
      // -=*# Resource for function HYPGEOMVERT #*=-
     Resource SC_OPCODE_HYP_GEOM_DIST
     {
@@ -7033,6 +7161,62 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "The population size." ;
         };
     };
+     // -=*# Resource for function HYPGEOM.DIST #*=-
+    Resource SC_OPCODE_HYP_GEOM_DIST_MS
+    {
+        String 1 // Description
+        {
+            Text [ en-US ] = "Values of the hypergeometric distribution." ;
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_STATISTIC;
+            U2S( HID_FUNC_HYP_GEOM_DIST_MS );
+            5;  0;  0;  0;  0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "X" ;
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "The number of successes in the sample." ;
+        };
+        String 4 // Name of Parameter 2
+        {
+            Text [ en-US ] = "n_sample" ;
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "The size of the sample." ;
+        };
+        String 6 // Name of Parameter 3
+        {
+            Text [ en-US ] = "successes" ;
+        };
+        String 7 // Description of Parameter 3
+        {
+            Text [ en-US ] = "The number of successes in the population." ;
+        };
+        String 8 // Name of Parameter 4
+        {
+            Text [ en-US ] = "n_population" ;
+        };
+        String 9 // Description of Parameter 4
+        {
+            Text [ en-US ] = "The population size." ;
+        };
+        String 10 // Name of Parameter 5
+        {
+            Text [ en-US ] = "C" ;
+        };
+        String 11 // Description of Parameter 5
+        {
+            Text [ en-US ] = "Cumulated. TRUE calculates the probabilty mass function, FALSE the cumulative distribution function." ;
+        };
+    };
      // -=*# Resource for function TVERT #*=-
     Resource SC_OPCODE_T_DIST
     {


More information about the Libreoffice-commits mailing list