sc/source/ui/app/inputwin.cxx | 24 ++++++++++++++++++++ sc/source/ui/view/viewfun2.cxx | 35 +++++++++++++++++++++++++++-- sc/uiconfig/scalc/ui/autosum.ui | 48 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-)
New commits: commit 75705bc48e1ad5cc4a31e810f77578ce462291fa Author: Dhiraj Holden <dhiraj.hol...@gmail.com> AuthorDate: Mon Dec 27 14:52:04 2021 -0500 Commit: Eike Rathke <er...@redhat.com> CommitDate: Tue Dec 28 15:23:45 2021 +0100 tdf#139602 Added all subtotal functions to autosum For every function that is an option for SUBTOTAL that was not already an option in autosum (that is COUNTA, PRODUCT, STDEV, STDEVP, VAR, VARP), the option was added in the autosum menu. Change-Id: Ic560cd45df206dafaa2d960550aaf185a1806806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127600 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 9029f23e5f95..2de934265b77 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1039,6 +1039,30 @@ void ScInputWindow::MenuHdl(std::string_view command) { eCode = ocCount; } + else if ( command == "counta" ) + { + eCode = ocCount2; + } + else if ( command == "product" ) + { + eCode = ocProduct; + } + else if (command == "stdev") + { + eCode = ocStDev; + } + else if (command == "stdevp") + { + eCode = ocStDevP; + } + else if (command == "var") + { + eCode = ocVar; + } + else if (command == "varp") + { + eCode = ocVarP; + } AutoSum( bRangeFinder, bSubTotal, eCode ); } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index f804ee27bf98..fd19f833540d 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -255,7 +255,14 @@ enum ScAutoSum ScAutoSumAverage, ScAutoSumMax, ScAutoSumMin, - ScAutoSumCount + ScAutoSumCount, + ScAutoSumCountA, + ScAutoSumProduct, + ScAutoSumStDev, + ScAutoSumStDevP, + ScAutoSumVar, + ScAutoSumVarP, + ScAutoSumEnd }; } @@ -284,6 +291,18 @@ static ScAutoSum lcl_IsAutoSumData( ScDocument& rDoc, SCCOL nCol, SCROW nRow, break; case ocCount : val = ScAutoSumCount; break; + case ocCount2 : val = ScAutoSumCountA; + break; + case ocProduct : val = ScAutoSumProduct; + break; + case ocStDev : val = ScAutoSumStDev; + break; + case ocStDevP : val = ScAutoSumStDevP; + break; + case ocVar : val = ScAutoSumVar; + break; + case ocVarP : val = ScAutoSumVarP; + break; default : break; } @@ -469,6 +488,18 @@ static sal_Int8 GetSubTotal( const OpCode eCode ) break; case ocCount : val = 2; break; + case ocCount2 : val = 3; + break; + case ocProduct : val = 6; + break; + case ocStDev : val = 7; + break; + case ocStDevP : val = 8; + break; + case ocVar : val = 10; + break; + case ocVarP : val = 11; + break; default : val = 9; } @@ -521,7 +552,7 @@ bool ScViewFunc::GetAutoSumArea( ScRangeList& rRangeList ) if ( bRow ) { nStartRow = nSeekRow; // nSeekRow might be adjusted via reference - if ( eSum >= ScAutoSumSum && eSum <= ScAutoSumCount ) + if ( eSum >= ScAutoSumSum && eSum < ScAutoSumEnd ) nEndRow = nStartRow; // only sum sums else nEndRow = nRow - 1; // maybe extend data area at bottom diff --git a/sc/uiconfig/scalc/ui/autosum.ui b/sc/uiconfig/scalc/ui/autosum.ui index 10845c4fe890..60d27f57c5d2 100644 --- a/sc/uiconfig/scalc/ui/autosum.ui +++ b/sc/uiconfig/scalc/ui/autosum.ui @@ -45,5 +45,53 @@ <property name="use_underline">True</property> </object> </child> + <child> + <object class="GtkMenuItem" id="counta"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|counta">CountA</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="product"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|product">Product</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="stdev"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|stdev">Stdev</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="stdevp"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|stdevp">StdevP</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="var"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|var">Var</property> + <property name="use_underline">True</property> + </object> + </child> + <child> + <object class="GtkMenuItem" id="varp"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes" context="autosum|varp">VarP</property> + <property name="use_underline">True</property> + </object> + </child> </object> </interface>