summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-04-24 00:21:30 +0200
committerTomaž Vajngerl <quikee@gmail.com>2017-04-24 08:37:14 +0200
commit3f4218ac543f49331e42869e632922cf5fbb5bda (patch)
tree69e098c8d7b15489e9cc41e1fc1d5835be90af07 /sc
parentc45358e928b9b9419bba10a0fcb661696cb7647a (diff)
tdf#107147 ignore subtotals and grandtotals when gathering labels
When gathering the labels and categories for the pivot chart, ignore subtotals and grandtotals so they don't end up in the chart. Change-Id: I45e80a59531d6a048a22016132e9bef280bb325c Reviewed-on: https://gerrit.libreoffice.org/36868 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 23323663c45b..fe1e383de966 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -350,6 +350,10 @@ void PivotTableDataProvider::collectPivotTableData()
OUString sName;
for (sheet::MemberResult const & rMember : aSequence)
{
+ if (rMember.Flags & sheet::MemberResultFlags::SUBTOTAL ||
+ rMember.Flags & sheet::MemberResultFlags::GRANDTOTAL)
+ continue;
+
if (rMember.Flags & sheet::MemberResultFlags::HASMEMBER ||
rMember.Flags & sheet::MemberResultFlags::CONTINUE)
{
@@ -390,6 +394,9 @@ void PivotTableDataProvider::collectPivotTableData()
for (sheet::MemberResult const & rMember : aSequence)
{
bool bHasContinueFlag = rMember.Flags & sheet::MemberResultFlags::CONTINUE;
+ if (rMember.Flags & sheet::MemberResultFlags::SUBTOTAL ||
+ rMember.Flags & sheet::MemberResultFlags::GRANDTOTAL)
+ continue;
if (rMember.Flags & sheet::MemberResultFlags::HASMEMBER || bHasContinueFlag)
{