[Libreoffice-commits] core.git: chart2/inc chart2/source sc/source

Caolán McNamara caolanm at redhat.com
Mon Feb 6 08:43:31 UTC 2017


 chart2/inc/ChartModel.hxx               |    6 ++++++
 chart2/source/model/main/ChartModel.cxx |   12 +++++++++++-
 chart2/source/view/main/ChartView.cxx   |   32 ++++++++++++++++++--------------
 sc/source/ui/drawfunc/fuins2.cxx        |    1 -
 sc/source/ui/view/tabvwsh4.cxx          |    1 -
 5 files changed, 35 insertions(+), 17 deletions(-)

New commits:
commit d8a1059ef2270681861da183ce486b636c07a4b7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Feb 5 22:40:13 2017 +0000

    OpenGLWindow typeinfo unavailable without HAVE_FEATURE_OPENGL
    
    Change-Id: Ie06c1121502db9b1a869f657f70d3b45db610e2f

diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 0599922..da23683 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -19,6 +19,8 @@
 #ifndef INCLUDED_CHART2_INC_CHARTMODEL_HXX
 #define INCLUDED_CHART2_INC_CHARTMODEL_HXX
 
+#include <config_features.h>
+
 #include "LifeTime.hxx"
 
 #include <com/sun/star/frame/XModel.hpp>
@@ -467,13 +469,17 @@ public:
     void getNextTimePoint();
     void setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd);
 
+#if HAVE_FEATURE_OPENGL
     OpenGLWindow* getOpenGLWindow() { return mpOpenGLWindow;}
+#endif
 
 private:
     sal_Int32 mnStart;
     sal_Int32 mnEnd;
     bool bSet;
+#if HAVE_FEATURE_OPENGL
     VclPtr<OpenGLWindow> mpOpenGLWindow;
+#endif
 };
 
 }  // namespace chart
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index f7a19f1..f76bb9f 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -107,8 +107,10 @@ ChartModel::ChartModel(uno::Reference<uno::XComponentContext > const & xContext)
                 "com.sun.star.xml.NamespaceMap", "com.sun.star.comp.chart.XMLNameSpaceMap" ), uno::UNO_QUERY)
     , mnStart(0)
     , mnEnd(0)
-    ,bSet(false)
+    , bSet(false)
+#if HAVE_FEATURE_OPENGL
     , mpOpenGLWindow(nullptr)
+#endif
 {
     osl_atomic_increment(&m_refCount);
     {
@@ -151,7 +153,9 @@ ChartModel::ChartModel( const ChartModel & rOther )
     , mnStart(rOther.mnStart)
     , mnEnd(rOther.mnEnd)
     , bSet(false)
+#if HAVE_FEATURE_OPENGL
     , mpOpenGLWindow(nullptr)
+#endif
 {
     osl_atomic_increment(&m_refCount);
     {
@@ -1350,8 +1354,12 @@ void ChartModel::setTimeBasedRange(sal_Int32 nStart, sal_Int32 nEnd)
 
 void ChartModel::setWindow( const sal_uInt64 nWindowPtr )
 {
+#if HAVE_FEATURE_OPENGL
     OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(nWindowPtr);
     mpOpenGLWindow = pWindow;
+#else
+    (void)nWindowPtr;
+#endif
 }
 
 void ChartModel::update()
@@ -1362,7 +1370,9 @@ void ChartModel::update()
     }
     mxChartView->setViewDirty();
     mxChartView->update();
+#if HAVE_FEATURE_OPENGL
     mxChartView->updateOpenGLWindow();
+#endif
 }
 
 }  // namespace chart
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 9440450..5e08015 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -1074,29 +1074,33 @@ public:
 
 #if HAVE_FEATURE_OPENGL
     const OpenGLWindow* getOpenGLWindow() const;
-#endif
     void updateOpenGLWindow();
+#endif
 private:
     ChartView* mpView;
     bool mbContextDestroyed;
+#if HAVE_FEATURE_OPENGL
     VclPtr<OpenGLWindow> mpWindow;
+#endif
 };
 
-GL2DRenderer::GL2DRenderer(ChartView* pView):
-    mpView(pView),
-    mbContextDestroyed(false),
-    mpWindow(mpView->mrChartModel.getOpenGLWindow())
+GL2DRenderer::GL2DRenderer(ChartView* pView)
+    : mpView(pView)
+    , mbContextDestroyed(false)
+#if HAVE_FEATURE_OPENGL
+    , mpWindow(mpView->mrChartModel.getOpenGLWindow())
+#endif
 {
 }
 
 GL2DRenderer::~GL2DRenderer()
 {
-    SolarMutexGuard g;
 #if HAVE_FEATURE_OPENGL
+    SolarMutexGuard g;
     if(!mbContextDestroyed && mpWindow)
         mpWindow->setRenderer(nullptr);
-#endif
     mpWindow.reset();
+#endif
 }
 
 void GL2DRenderer::update()
@@ -1129,15 +1133,12 @@ const OpenGLWindow* GL2DRenderer::getOpenGLWindow() const
     return mpWindow;
 }
 
-#endif
-
 void GL2DRenderer::updateOpenGLWindow()
 {
     if(mbContextDestroyed)
         return;
 
     OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow();
-#if HAVE_FEATURE_OPENGL
     if(pWindow != mpWindow)
     {
         if(mpWindow)
@@ -1150,10 +1151,11 @@ void GL2DRenderer::updateOpenGLWindow()
             pWindow->setRenderer(this);
         }
     }
-#endif
     mpWindow = pWindow;
 }
 
+#endif
+
 const uno::Sequence<sal_Int8>& ExplicitValueProvider::getUnoTunnelId()
 {
     return theExplicitValueProviderUnoTunnelId::get().getSeq();
@@ -3315,6 +3317,7 @@ bool ChartView::createAxisTitleShapes2D( CreateShapeParam2D& rParam, const css::
 
 void ChartView::createShapes3D()
 {
+#if HAVE_FEATURE_OPENGL
     OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow();
     if(!pWindow)
         return;
@@ -3354,7 +3357,6 @@ void ChartView::createShapes3D()
 
     uno::Reference< XChartType > xChartType( aChartTypeList[0] );
 
-#if HAVE_FEATURE_OPENGL
     if (!m_pGL3DPlotter)
     {
         m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
@@ -3365,7 +3367,6 @@ void ChartView::createShapes3D()
         if (pChart)
             pChart->setOpenGLWindow(pWindow);
     }
-#endif
 
     uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
     OSL_ASSERT( xDataSeriesContainer.is());
@@ -3385,19 +3386,22 @@ void ChartView::createShapes3D()
 
     std::unique_ptr<ExplicitCategoriesProvider> pCatProvider(new ExplicitCategoriesProvider(xCooSys, mrChartModel));
 
-#if HAVE_FEATURE_OPENGL
     m_pGL3DPlotter->create3DShapes(aDataSeries, *pCatProvider);
 
     m_pGL3DPlotter->render();
 #endif
 }
 
+#if HAVE_FEATURE_OPENGL
+
 void ChartView::updateOpenGLWindow()
 {
     if(!isReal3DChart())
         mp2DRenderer->updateOpenGLWindow();
 }
 
+#endif
+
 } //namespace chart
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index a948850..6f10373 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -31,7 +31,6 @@
 #include <tools/urlobj.hxx>
 #include <vcl/msgbox.hxx>
 #include <vcl/syschild.hxx>
-#include <vcl/openglwin.hxx>
 #include <svl/urihelper.hxx>
 #include <unotools/moduleoptions.hxx>
 #include <svtools/insdlg.hxx>
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 5425f76..cb5b7f5 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -38,7 +38,6 @@
 #include <unotools/moduleoptions.hxx>
 #include <tools/urlobj.hxx>
 #include <sfx2/docfile.hxx>
-#include <vcl/openglwin.hxx>
 #include <o3tl/make_unique.hxx>
 
 #include "tabvwsh.hxx"


More information about the Libreoffice-commits mailing list