summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-04-08 23:43:14 +0200
committerTomaž Vajngerl <quikee@gmail.com>2017-04-10 08:52:00 +0200
commitabd8c3646e1295e68fe317bc1a02148a1b5f41a4 (patch)
treee1101f1a045fd1028f8e88e2f7f636b740538688 /sc/source
parent67af00a76a3bb86790447e2b223b03c5dddacc4a (diff)
pivotcharts: ignore subtotals, grand totals in pivot table data
Change-Id: I08cdd28aaae536fa8306446168dcdb977897dfcd Reviewed-on: https://gerrit.libreoffice.org/36308 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/unoobj/PivotTableDataProvider.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 5eb66c65257a..df7b180c6892 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -265,9 +265,8 @@ void PivotTableDataProvider::collectPivotTableData()
{
ScDPCollection* pDPCollection = m_pDocument->GetDPCollection();
ScDPObject* pDPObject = pDPCollection->GetByName(m_sPivotTableName);
-
- uno::Reference<sheet::XDataPilotResults> xDPResults(pDPObject->GetSource(), uno::UNO_QUERY);
- uno::Sequence<uno::Sequence<sheet::DataResult>> xDataResultsSequence = xDPResults->getResults();
+ if (!pDPObject)
+ return;
m_aCategoriesColumnOrientation.clear();
m_aCategoriesRowOrientation.clear();
@@ -278,6 +277,9 @@ void PivotTableDataProvider::collectPivotTableData()
m_aPageFields.clear();
m_aDataFields.clear();
+ uno::Reference<sheet::XDataPilotResults> xDPResults(pDPObject->GetSource(), uno::UNO_QUERY);
+ uno::Sequence<uno::Sequence<sheet::DataResult>> xDataResultsSequence = xDPResults->getResults();
+
double fNan;
rtl::math::setNan(&fNan);
@@ -286,6 +288,8 @@ void PivotTableDataProvider::collectPivotTableData()
size_t nIndex = 0;
for (sheet::DataResult const & rDataResult : xDataResults)
{
+ if (rDataResult.Flags & css::sheet::DataResultFlags::SUBTOTAL)
+ continue;
if (rDataResult.Flags == 0 || rDataResult.Flags & css::sheet::DataResultFlags::HASDATA)
{
if (nIndex >= m_aDataRowVector.size())