summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-02-05 22:40:13 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-02-06 08:42:55 +0000
commitd8a1059ef2270681861da183ce486b636c07a4b7 (patch)
treee8efc3df30bd9fdba0d8d4439b321f45b65bfd92 /chart2
parentloplugin:unusedenumconstants in reportdesign (diff)
downloadcore-d8a1059ef2270681861da183ce486b636c07a4b7.tar.gz
core-d8a1059ef2270681861da183ce486b636c07a4b7.zip
OpenGLWindow typeinfo unavailable without HAVE_FEATURE_OPENGL
Change-Id: Ie06c1121502db9b1a869f657f70d3b45db610e2f
Diffstat (limited to 'chart2')
-rw-r--r--chart2/inc/ChartModel.hxx6
-rw-r--r--chart2/source/model/main/ChartModel.cxx12
-rw-r--r--chart2/source/view/main/ChartView.cxx32
3 files changed, 35 insertions, 15 deletions
diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 05999229a296..da2368351143 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 f7a19f16bf86..f76bb9faf2ff 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 94404507feb2..5e08015edba9 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