summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-03-07 16:38:07 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2017-03-30 23:52:43 +0200
commitc6356661bf9388b9c30763867d5e9e355965adb5 (patch)
tree0ed5362e439ce2722888ed0f935219e0dbdee567
parent5be43b2a5dbf13075b0c1206451ec707d6130369 (diff)
chart model: checks if data provider is pivot table or sheet
Change-Id: I5f71004f15b72e6d0ef6bef30ee5814f31e4b1e7
-rw-r--r--chart2/inc/ChartModel.hxx4
-rw-r--r--chart2/source/model/main/ChartModel.cxx12
2 files changed, 16 insertions, 0 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 29b764b6c546..90ee82c56966 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -469,6 +469,10 @@ public:
void setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd);
+ bool isDataFromSpreadsheet();
+
+ bool isDataFromPivotTable();
+
#if HAVE_FEATURE_OPENGL
OpenGLWindow* getOpenGLWindow() { return mpOpenGLWindow;}
#endif
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index d12e8b54418d..d2f6c68f6361 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -38,6 +38,7 @@
#include <vcl/openglwin.hxx>
#include <com/sun/star/chart/ChartDataRowSource.hpp>
+#include <com/sun/star/chart2/data/XPivotChartDataProvider.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -1355,6 +1356,17 @@ void ChartModel::update()
#endif
}
+bool ChartModel::isDataFromSpreadsheet()
+{
+ return !isDataFromPivotTable() && !hasInternalDataProvider();
+}
+
+bool ChartModel::isDataFromPivotTable()
+{
+ uno::Reference<chart2::data::XPivotChartDataProvider> xPivotChartDataProvider(m_xDataProvider, uno::UNO_QUERY);
+ return xPivotChartDataProvider.is();
+}
+
} // namespace chart
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL