summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2013-11-01 20:29:06 +0100
committerEike Rathke <erack@redhat.com>2013-11-04 11:12:52 -0600
commite362bc7892e0fd193e541838be4bd26b7ff42fdd (patch)
treef0051617539084bae176311b9062b21d8ab500c9 /sc
parent4bfa4a69a89337f1839a310a2fe83caf82e37df5 (diff)
fdo#71081 add Excel 2010 functions BINOM.DIST and BINOM.INV
Change-Id: Iaecccd9ec6ab6a08c6c7ee8c024a3eba48ca1682 Reviewed-on: https://gerrit.libreoffice.org/6521 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/helpids.h2
-rw-r--r--sc/qa/unit/ucalc.cxx2
-rw-r--r--sc/source/core/tool/interpr4.cxx4
-rw-r--r--sc/source/filter/excel/xlformula.cxx4
-rw-r--r--sc/source/filter/oox/formulabase.cxx4
-rw-r--r--sc/source/ui/src/scfuncs.src88
6 files changed, 101 insertions, 3 deletions
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h
index 820086ea31f1..12c39d6dfe56 100644
--- a/sc/inc/helpids.h
+++ b/sc/inc/helpids.h
@@ -686,5 +686,7 @@
#define HID_FUNC_VAR_S "SC_HID_FUNC_VAR_S"
#define HID_FUNC_BETADIST_MS "SC_HID_FUNC_BETADIST_MS"
#define HID_FUNC_BETAINV_MS "SC_HID_FUNC_BETAINV_MS"
+#define HID_FUNC_BINOM_DIST_MS "SC_HID_FUNC_BINOM_DIST_MS"
+#define HID_FUNC_BINOM_INV_MS "SC_HID_FUNC_BINOM_INV_MS"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b5de6a5fc5a3..0b34f8104c1e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2361,6 +2361,8 @@ void Test::testFunctionLists()
"BETA.INV",
"BETADIST",
"BETAINV",
+ "BINOM.DIST",
+ "BINOM.INV",
"BINOMDIST",
"CHIDIST",
"CHIINV",
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 97db18c5cc67..35488e5ec9c2 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4100,7 +4100,8 @@ StackVar ScInterpreter::Interpret()
case ocB : ScB(); break;
case ocNormDist : ScNormDist(); break;
case ocExpDist : ScExpDist(); break;
- case ocBinomDist : ScBinomDist(); break;
+ case ocBinomDist :
+ case ocBinomDist_MS : ScBinomDist(); break;
case ocPoissonDist : ScPoissonDist(); break;
case ocKombin : ScKombin(); break;
case ocKombin2 : ScKombin2(); break;
@@ -4123,6 +4124,7 @@ StackVar ScInterpreter::Interpret()
case ocGeoMean : ScGeoMean(); break;
case ocHarMean : ScHarMean(); break;
case ocWeibull : ScWeibull(); break;
+ case ocBinomInv :
case ocKritBinom : ScCritBinom(); break;
case ocNegBinomVert : ScNegBinomDist(); break;
case ocNoName : ScNoName(); break;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index 78c443868076..10cc2fe1ce1a 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -436,7 +436,9 @@ static const XclFunctionInfo saFuncTable_2010[] =
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( 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" )
};
/** Functions new in Excel 2013.
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index 146f3322a83d..e5bd94c9ee3e 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -754,7 +754,9 @@ static const FunctionData saFuncTable2010[] =
{ "COM.MICROSOFT.VAR.P", "VAR.P" , NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.VAR.S", "VAR.S", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
{ "COM.MICROSOFT.BETA.DIST", "BETA.DIST" , NOID, NOID, 4, 6, V, { VR }, FUNCFLAG_MACROCALL_NEW },
- { "COM.MICROSOFT.BETA.INV", "BETA.INV", NOID, NOID, 3, 5, V, { VR }, FUNCFLAG_MACROCALL_NEW }
+ { "COM.MICROSOFT.BETA.INV", "BETA.INV", NOID, NOID, 3, 5, V, { VR }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.BINOM.DIST", "BINOM.DIST", NOID, NOID, 4, 4, V, { VR }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.BINOM.INV", "BINOM.INV", NOID, NOID, 3, 3, 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 18b6b79cfe37..b68608285bce 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -6087,6 +6087,54 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "Cumulated. C=0 calculates the individual probability, C=1 the cumulated probability." ;
};
};
+ // -=*# Resource for function BINOM.DIST #*=-
+ Resource SC_OPCODE_BINOM_DIST_MS
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Values of the binomial distribution." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_BINOM_DIST_MS );
+ 4; 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 a series of trials." ;
+ };
+ String 4 // Name of Parameter 2
+ {
+ Text [ en-US ] = "trials" ;
+ };
+ String 5 // Description of Parameter 2
+ {
+ Text [ en-US ] = "The total number of trials." ;
+ };
+ String 6 // Name of Parameter 3
+ {
+ Text [ en-US ] = "SP" ;
+ };
+ String 7 // Description of Parameter 3
+ {
+ Text [ en-US ] = "The success probability of a trial." ;
+ };
+ String 8 // Name of Parameter 4
+ {
+ Text [ en-US ] = "C" ;
+ };
+ String 9 // Description of Parameter 4
+ {
+ Text [ en-US ] = "Cumulated. C=0 calculates the individual probability, C=1 the cumulated probability." ;
+ };
+ };
// -=*# Resource for function NEGBINOMVERT #*=-
Resource SC_OPCODE_NEG_BINOM_VERT
{
@@ -6167,6 +6215,46 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "The border probability that is attained or exceeded." ;
};
};
+ // -=*# Resource for function BINOM.INV #*=-
+ Resource SC_OPCODE_BINOM_INV
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Border arguments of the binomial distribution." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_BINOM_INV_MS );
+ 3; 0; 0; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "trials" ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "The total number of trials." ;
+ };
+ String 4 // Name of Parameter 2
+ {
+ Text [ en-US ] = "SP" ;
+ };
+ String 5 // Description of Parameter 2
+ {
+ Text [ en-US ] = "The success probability of a trial." ;
+ };
+ String 6 // Name of Parameter 3
+ {
+ Text [ en-US ] = "alpha" ;
+ };
+ String 7 // Description of Parameter 3
+ {
+ Text [ en-US ] = "The border probability that is attained or exceeded." ;
+ };
+ };
// -=*# Resource for function POISSON #*=-
Resource SC_OPCODE_POISSON_DIST
{