[Libreoffice-commits] core.git: chart2/qa sc/source
Tomaž Vajngerl
tomaz.vajngerl at collabora.co.uk
Mon Apr 24 06:37:45 UTC 2017
chart2/qa/extras/PivotChartTest.cxx | 6 +++---
sc/source/ui/unoobj/PivotTableDataProvider.cxx | 7 +++++++
2 files changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 3f4218ac543f49331e42869e632922cf5fbb5bda
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date: Mon Apr 24 00:21:30 2017 +0200
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 at libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx
index 0d7056f974e4..dc97b629bbed 100644
--- a/chart2/qa/extras/PivotChartTest.cxx
+++ b/chart2/qa/extras/PivotChartTest.cxx
@@ -705,9 +705,9 @@ void PivotChartTest::testPivotTableDataProvider_PivotTableFields()
aFieldEntries = xPivotTableDataProvider->getDataFields();
- //CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength());
- //CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T1"), aFieldEntries[0].Name);
- //CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T2"), aFieldEntries[1].Name);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), aFieldEntries.getLength());
+ CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T1"), aFieldEntries[0].Name);
+ CPPUNIT_ASSERT_EQUAL(OUString("Sum - Sales T2"), aFieldEntries[1].Name);
}
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)
{
More information about the Libreoffice-commits
mailing list