sc/source/ui/view/cellsh1.cxx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
New commits: commit bf34c041ed1869e7e544cf75966c9f42960cb2d3 Author: Eike Rathke <er...@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 <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index b7d5486a8ab7..be04ff40351b 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2959,12 +2959,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); @@ -2973,6 +2978,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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits