sc/source/core/data/subtotalparam.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit d5c36d5e775fa48c011570eb876317c21727baa0
Author:     Balazs Varga <[email protected]>
AuthorDate: Fri Dec 5 12:23:36 2025 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Fri Dec 5 20:55:37 2025 +0100

    Table Styles: fix not removed total function in case of
    
    0 new value. Remove/reset total functions or labels if
    have no any new ones.
    
    Change-Id: Ibac6d172b7d3ed0146e35177f7c8831ad34974b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195075
    Reviewed-by: Balazs Varga <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/sc/source/core/data/subtotalparam.cxx 
b/sc/source/core/data/subtotalparam.cxx
index be9a95fc6767..448968d81efb 100644
--- a/sc/source/core/data/subtotalparam.cxx
+++ b/sc/source/core/data/subtotalparam.cxx
@@ -171,8 +171,7 @@ void ScSubTotalParam::SetCustFuncs(sal_uInt16 nGroup,
                        sal_uInt16 nCount )
 {
     OSL_ENSURE((nGroup <= MAXSUBTOTAL), "ScSubTotalParam::SetCustFuncs(): 
nGroup > MAXSUBTOTAL!");
-    OSL_ENSURE((nCount > 0), "ScSubTotalParam::SetCustFuncs(): nCount == 0!");
-    if (!(nCount > 0 && nGroup <= MAXSUBTOTAL))
+    if (nGroup > MAXSUBTOTAL)
         return;
 
     aGroups[nGroup].AllocCustFuncs(nCount);
@@ -185,9 +184,7 @@ void ScSubTotalParam::SetSubLabels(sal_uInt16 nGroup,
                        sal_uInt16 nCount )
 {
     OSL_ENSURE((nGroup <= MAXSUBTOTAL), "ScSubTotalParam::SetSubLabels(): 
nGroup > MAXSUBTOTAL!");
-    OSL_ENSURE((nCount > 0), "ScSubTotalParam::SetSubLabels(): nCount == 0!");
-
-    if (!(nCount > 0 && nGroup <= MAXSUBTOTAL))
+    if (nGroup > MAXSUBTOTAL)
         return;
 
     aGroups[nGroup].AllocSubLabels(nCount);

Reply via email to