[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sc/source

Eike Rathke erack at redhat.com
Tue Jul 10 00:21:45 UTC 2018


 sc/source/ui/view/cellsh1.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 822add7e1de83ba3a405c1927cb0924c7d6a748a
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Jul 9 19:31:26 2018 +0200

    Resolves: tdf#118638 preset include format patterns for anonymous subtotals
    
    Change-Id: I48bc9d5e2bbdee58687dd87e38cad8e9af9de408
    Reviewed-on: https://gerrit.libreoffice.org/57194
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit bf34c041ed1869e7e544cf75966c9f42960cb2d3)
    Reviewed-on: https://gerrit.libreoffice.org/57206
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 3f9a13c03e62..f489346019c1 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2998,12 +2998,17 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
     ScSubTotalParam aSubTotalParam;
     SfxItemSet aArgSet( GetPool(), svl::Items<SCITEM_SUBTDATA, SCITEM_SUBTDATA>{} );
 
+    bool bAnonymous;
+
     // Only get existing named database range.
     ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD);
-    if (!pDBData)
+    if (pDBData)
+        bAnonymous = false;
+    else
     {
         // No existing DB data at this position.  Create an
         // anonymous DB.
+        bAnonymous = true;
         pDBData = pTabViewShell->GetAnonymousDBData();
         ScRange aDataRange;
         pDBData->GetArea(aDataRange);
@@ -3012,6 +3017,13 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
 
     pDBData->GetSubTotalParam( aSubTotalParam );
     aSubTotalParam.bRemoveOnly = false;
+    if (bAnonymous)
+    {
+        // Preset sort formatting along with values and also create formula
+        // cells with "needs formatting". Subtotals on data of different types
+        // doesn't make much sense anyway.
+        aSubTotalParam.bIncludePattern = true;
+    }
 
     aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), &aSubTotalParam ) );
     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();


More information about the Libreoffice-commits mailing list