summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2013-10-20 09:38:19 +0200
committerEike Rathke <erack@redhat.com>2013-10-25 13:07:32 +0000
commit4a122d1e61278debe7e386e3d9f442e68eddba9b (patch)
tree32847e55a1516cdbc4253604c40217f0b2b7870d /sc
parentb5efef87efdce56c2491e6de1370ad42b998a8df (diff)
fdo#44134 adding Excel 2010 functions STDEV.P and STDEV.S
Change-Id: If7b2767a69285ac72fa7120b1149a66f118cce8f Reviewed-on: https://gerrit.libreoffice.org/6354 Tested-by: Eike Rathke <erack@redhat.com> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx2
-rw-r--r--sc/source/core/tool/interpr4.cxx6
-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.src48
5 files changed, 60 insertions, 4 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8e5557304efd..db82ac470c43 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2425,6 +2425,8 @@ void Test::testFunctionLists()
"SMALL",
"STANDARDIZE",
"STDEV",
+ "STDEV.P",
+ "STDEV.S",
"STDEVA",
"STDEVP",
"STDEVPA",
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index af6424c01289..1a3e13110f1b 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4013,9 +4013,11 @@ StackVar ScInterpreter::Interpret()
case ocVarA : ScVar( true ); break;
case ocVarP : ScVarP( false ); break;
case ocVarPA : ScVarP( true ); break;
- case ocStDev : ScStDev( false ); break;
+ case ocStDev :
+ case ocStDevS : ScStDev( false ); break;
case ocStDevA : ScStDev( true ); break;
- case ocStDevP : ScStDevP( false ); break;
+ case ocStDevP :
+ case ocStDevP_MS : ScStDevP( false ); break;
case ocStDevPA : ScStDevP( true ); break;
case ocBW : ScBW(); break;
case ocDIA : ScDIA(); break;
diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx
index f293230c4885..dc87d74403f7 100644
--- a/sc/source/filter/excel/xlformula.cxx
+++ b/sc/source/filter/excel/xlformula.cxx
@@ -408,7 +408,9 @@ 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_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" )
};
/** Functions new in Excel 2013.
diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx
index d119a88142fc..09ac0668280f 100644
--- a/sc/source/filter/oox/formulabase.cxx
+++ b/sc/source/filter/oox/formulabase.cxx
@@ -747,7 +747,9 @@ static const FunctionData saFuncTableOox[] =
static const FunctionData saFuncTable2010[] =
{
{ "COM.MICROSOFT.COVARIANCE.P", "COVARIANCE.P", NOID, NOID, 2, 2, V, { VA }, FUNCFLAG_MACROCALL_NEW },
- { "COM.MICROSOFT.COVARIANCE.S", "COVARIANCE.S", NOID, NOID, 2, 2, V, { VA }, FUNCFLAG_MACROCALL_NEW }
+ { "COM.MICROSOFT.COVARIANCE.S", "COVARIANCE.S", NOID, NOID, 2, 2, V, { VA }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.STDEV.P", "STDEV.P", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW },
+ { "COM.MICROSOFT.STDEV.S", "STDEV.S", NOID, NOID, 1, MX, V, { RX }, 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 93ea5c345e60..11fdecb450e7 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -5183,6 +5183,30 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
};
};
+ // -=*# Resource for function STDEV.S #*=-
+ Resource SC_OPCODE_ST_DEV_S
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Calculates the standard deviation based on a sample." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_STABW );
+ VAR_ARGS; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "number " ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
+ };
+ };
// -=*# Resource for function STABWA #*=-
Resource SC_OPCODE_ST_DEV_A
{
@@ -5231,6 +5255,30 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
};
};
+ // -=*# Resource for function STDEV.P #*=-
+ Resource SC_OPCODE_ST_DEV_P_MS
+ {
+ String 1 // Description
+ {
+ Text [ en-US ] = "Calculates the standard deviation based on the entire population." ;
+ };
+ ExtraData =
+ {
+ 0;
+ ID_FUNCTION_GRP_STATISTIC;
+ U2S( HID_FUNC_STABWN );
+ VAR_ARGS; 0;
+ 0;
+ };
+ String 2 // Name of Parameter 1
+ {
+ Text [ en-US ] = "number " ;
+ };
+ String 3 // Description of Parameter 1
+ {
+ Text [ en-US ] = "Number 1, number 2, ... are 1 to 30 numerical arguments which portray a sample of a population." ;
+ };
+ };
// -=*# Resource for function STABWNA #*=-
Resource SC_OPCODE_ST_DEV_P_A
{