[Libreoffice-commits] core.git: Branch 'feature/pivotcharts' - chart2/inc chart2/source

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Tue Mar 7 15:42:12 UTC 2017


 chart2/inc/ChartModel.hxx               |    4 ++++
 chart2/source/model/main/ChartModel.cxx |   12 ++++++++++++
 2 files changed, 16 insertions(+)

New commits:
commit af698a5eb198e124dddc92967bb518351f3f69e1
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Mar 7 16:38:07 2017 +0100

    chart model: checks if data provider is pivot table or sheet
    
    Change-Id: I5f71004f15b72e6d0ef6bef30ee5814f31e4b1e7

diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 04e3be2..d6123bd 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 a8dae67..b1faf4b 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>
@@ -1358,6 +1359,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


More information about the Libreoffice-commits mailing list