diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2013-11-07 17:27:20 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-11-08 11:34:04 -0600 |
commit | 75601529a807f15fa648c22e3636281981cd7623 (patch) | |
tree | eb253c4c697a8e6a2d48d0bb1f6b9d4e8f9e0edc /sc | |
parent | c69ed33628ec0b7abf6296539cf280d6c4265930 (diff) |
fdo#70797 add Excel 2010 functions
CHISQ.DIST, CHISQ.INV, CHISQ.TEST, CHISQ.DIST.RT, CHISQ.INV.RT
Change-Id: If32530a82b2e5fa1aa30a8c80090742be5acf3eb
Reviewed-on: https://gerrit.libreoffice.org/6611
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/helpids.h | 5 | ||||
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 5 | ||||
-rw-r--r-- | sc/source/core/tool/interpr4.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/excel/xlformula.cxx | 7 | ||||
-rw-r--r-- | sc/source/filter/oox/formulabase.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/src/scfuncs.src | 174 |
6 files changed, 205 insertions, 8 deletions
diff --git a/sc/inc/helpids.h b/sc/inc/helpids.h index 12c39d6dfe56..71bb83ebb077 100644 --- a/sc/inc/helpids.h +++ b/sc/inc/helpids.h @@ -688,5 +688,10 @@ #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" +#define HID_FUNC_CHIINV_MS "SC_HID_FUNC_CHIINV_MS" +#define HID_FUNC_CHIVERT_MS "SC_HID_FUNC_CHIVERT_MS" +#define HID_FUNC_CHITEST_MS "SC_HID_FUNC_CHITEST_MS" +#define HID_FUNC_CHISQDIST_MS "SC_HID_FUNC_CHISQDIST_MS" +#define HID_FUNC_CHISQINV_MS "SC_HID_FUNC_CHISQINV_MS" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 0b34f8104c1e..3c9cd72ee2b7 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -2366,6 +2366,11 @@ void Test::testFunctionLists() "BINOMDIST", "CHIDIST", "CHIINV", + "CHISQ.DIST", + "CHISQ.DIST.RT", + "CHISQ.INV", + "CHISQ.INV.RT", + "CHISQ.TEST", "CHISQDIST", "CHISQINV", "CHITEST", diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 35488e5ec9c2..53fdcd2fa10b 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -4111,8 +4111,10 @@ StackVar ScInterpreter::Interpret() case ocLogNormDist : ScLogNormDist(); break; case ocTDist : ScTDist(); break; case ocFDist : ScFDist(); break; - case ocChiDist : ScChiDist(); break; - case ocChiSqDist : ScChiSqDist(); break; + case ocChiDist : + case ocChiDist_MS : ScChiDist(); break; + case ocChiSqDist : + case ocChiSqDist_MS : ScChiSqDist(); break; case ocStandard : ScStandard(); break; case ocAveDev : ScAveDev(); break; case ocDevSq : ScDevSq(); break; @@ -4162,9 +4164,12 @@ StackVar ScInterpreter::Interpret() case ocGamma : ScGamma(); break; case ocGammaDist : ScGammaDist(); break; case ocGammaInv : ScGammaInv(); break; - case ocChiTest : ScChiTest(); break; - case ocChiInv : ScChiInv(); break; - case ocChiSqInv : ScChiSqInv(); break; + case ocChiTest : + case ocChiTest_MS : ScChiTest(); break; + case ocChiInv : + case ocChiInv_MS : ScChiInv(); break; + case ocChiSqInv : + case ocChiSqInv_MS : ScChiSqInv(); break; case ocTInv : ScTInv(); break; case ocFInv : ScFInv(); break; case ocLogInv : ScLogNormInv(); break; diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 343a46ff2c81..6d159bd8cabc 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -438,7 +438,12 @@ static const XclFunctionInfo saFuncTable_2010[] = 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( 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" ) }; /** Functions new in Excel 2013. diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index e5bd94c9ee3e..582ea145e328 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -756,7 +756,12 @@ static const FunctionData saFuncTable2010[] = { "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.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 } + { "COM.MICROSOFT.BINOM.INV", "BINOM.INV", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW }, + { "COM.MICROSOFT.CHISQ.DIST", "CHISQ.DIST", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW }, + { "COM.MICROSOFT.CHISQ.INV", "CHISQ.INV", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, + { "COM.MICROSOFT.CHISQ.DIST.RT", "CHISQ.DIST.RT", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, + { "COM.MICROSOFT.CHISQ.INV.RT", "CHISQ.INV.RT", NOID, NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, + { "COM.MICROSOFT.CHISQ.TEST", "CHISQ.TEST", NOID, NOID, 2, 2, V, { VA }, 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 b68608285bce..60d8a8e1d5dd 100644 --- a/sc/source/ui/src/scfuncs.src +++ b/sc/source/ui/src/scfuncs.src @@ -7185,7 +7185,7 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 Text [ en-US ] = "The degrees of freedom in the denominator of the F distribution." ; }; }; - // -=*# Resource for function CHIVERT #*=- + // -=*# Resource for function CHIDIST #*=- Resource SC_OPCODE_CHI_DIST { String 1 // Description @@ -7217,6 +7217,39 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 Text [ en-US ] = "The degrees of freedom of the chi square distribution." ; }; }; + // -=*# Resource for function CHISQ.DIST.RT #*=- + Resource SC_OPCODE_CHI_DIST_MS + { + String 1 // Description + { + Text [ en-US ] = "Returns the right-tail probability of the chi-square distribution." ; + }; + ExtraData = + { + 0; + ID_FUNCTION_GRP_STATISTIC; + U2S( HID_FUNC_CHIVERT_MS ); + 2; 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 chi square distribution is to be calculated." ; + }; + String 4 // Name of Parameter 2 + { + Text [ en-US ] = "degrees_freedom" ; + }; + String 5 // Description of Parameter 2 + { + Text [ en-US ] = "The degrees of freedom of the chi square distribution." ; + }; + }; + // -=*# Resource for function CHISQDIST #*=- Resource SC_OPCODE_CHISQ_DIST @@ -7259,6 +7292,47 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; }; + // -=*# Resource for function CHISQ.DIST #*=- + Resource SC_OPCODE_CHISQ_DIST_MS + { + String 1 // Description + { + Text [ en-US ] = "Returns left-tail probability of the cumulative distribution function or values of the probability density function of the chi-square distribution." ; + }; + ExtraData = + { + 0; + ID_FUNCTION_GRP_STATISTIC; + U2S( HID_FUNC_CHISQDIST_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 for which the probability density function or cumulative distribution function is to be calculated." ; + }; + String 4 // Name of Parameter 2 + { + Text [ en-US ] = "Degrees of Freedom" ; + }; + String 5 // Description of Parameter 2 + { + Text [ en-US ] = "The degrees of freedom of the chi-square 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 CHIINV #*=- Resource SC_OPCODE_CHI_INV @@ -7293,6 +7367,39 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; }; + // -=*# Resource for function CHISQ.INV.RT #*=- + Resource SC_OPCODE_CHI_INV_MS + { + String 1 // Description + { + Text [ en-US ] = "Values of the inverse of CHIDIST(x; DegreesOfFreedom)." ; + }; + ExtraData = + { + 0; + ID_FUNCTION_GRP_STATISTIC; + U2S( HID_FUNC_CHIINV_MS ); + 2; 0; 0; + 0; + }; + String 2 // Name of Parameter 1 + { + Text [ en-US ] = "number" ; + }; + String 3 // Description of Parameter 1 + { + Text [ en-US ] = "The probability value for which the inverse chi square distribution is to be calculated." ; + }; + String 4 // Name of Parameter 2 + { + Text [ en-US ] = "degrees_freedom" ; + }; + String 5 // Description of Parameter 2 + { + Text [ en-US ] = "The degrees of freedom of the chi square distribution." ; + }; + }; + // -=*# Resource for function CHISQINV #*=- Resource SC_OPCODE_CHISQ_INV { @@ -7326,6 +7433,39 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 }; }; + // -=*# Resource for function CHISQ.INV #*=- + Resource SC_OPCODE_CHISQ_INV_MS + { + String 1 // Description + { + Text [ en-US ] = "Values of the inverse of CHISQ.DIST(x;DegreesOfFreedom;TRUE())." ; + }; + ExtraData = + { + 0; + ID_FUNCTION_GRP_STATISTIC; + U2S( HID_FUNC_CHISQINV_MS ); + 2; 0; 0; + 0; + }; + String 2 // Name of Parameter 1 + { + Text [ en-US ] = "Probability" ; + }; + String 3 // Description of Parameter 1 + { + Text [ en-US ] = "The probability value for which the inverse of the chi square distribution is to be calculated." ; + }; + String 4 // Name of Parameter 2 + { + Text [ en-US ] = "Degrees of Freedom" ; + }; + String 5 // Description of Parameter 2 + { + Text [ en-US ] = "The degrees of freedom of the chi square distribution." ; + }; + }; + // -=*# Resource for function STANDARDISIERUNG #*=- Resource SC_OPCODE_STANDARD { @@ -7542,6 +7682,38 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2 Text [ en-US ] = "The expected data array." ; }; }; + // -=*# Resource for function CHISQ.TEST.RT #*=- + Resource SC_OPCODE_CHI_TEST_MS + { + String 1 // Description + { + Text [ en-US ] = "Returns the chi square independence test." ; + }; + ExtraData = + { + 0; + ID_FUNCTION_GRP_STATISTIC; + U2S( HID_FUNC_CHITEST_MS ); + 2; 0; 0; + 0; + }; + String 2 // Name of Parameter 1 + { + Text [ en-US ] = "Data_B" ; + }; + String 3 // Description of Parameter 1 + { + Text [ en-US ] = "The observed data array." ; + }; + String 4 // Name of Parameter 2 + { + Text [ en-US ] = "data_E" ; + }; + String 5 // Description of Parameter 2 + { + Text [ en-US ] = "The expected data array." ; + }; + }; // -=*# Resource for function FTEST #*=- Resource SC_OPCODE_F_TEST { |