summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2016-03-23 13:40:13 +0100
committerOliver Specht <oliver.specht@cib.de>2016-03-25 11:05:47 +0000
commit96c1ae1d8e78ae8b9bd7d4001645cad24d62b720 (patch)
tree1482b9e0b899a783f64aaed3b9728533a81eff58 /chart2/source
parent44a6d8ac3063511a149d4abdd6c2a556b3f477fe (diff)
fix headless build
disables OpenGL and glew usage, lets --without-gui do what --without-x did before and disables X related test Change-Id: I680b47c9962a0d43c8ece593db0b82e347ceebdb Reviewed-on: https://gerrit.libreoffice.org/23474 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/main/ChartWindow.cxx6
-rw-r--r--chart2/source/model/template/ChartTypeManager.cxx9
-rw-r--r--chart2/source/view/main/ChartView.cxx24
3 files changed, 32 insertions, 7 deletions
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 1c6d6ae4b0db..25bdc33c7a13 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -24,7 +24,7 @@
#include <vcl/help.hxx>
#include <vcl/openglwin.hxx>
#include <vcl/settings.hxx>
-
+#include <config_features.h>
#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
using namespace ::com::sun::star;
@@ -49,7 +49,11 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi
: Window(pParent, nStyle)
, m_pWindowController( pController )
, m_bInPaint(false)
+#if HAVE_FEATURE_OPENGL
, m_pOpenGLWindow(VclPtr<OpenGLWindow>::Create(this))
+#else
+ , m_pOpenGLWindow(nullptr)
+#endif
{
this->SetHelpId( HID_SCH_WIN_DOCUMENT );
this->SetMapMode( MapMode(MAP_100TH_MM) );
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index adee48ecad68..a8b96e42a226 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -33,7 +33,10 @@
#include "StockChartTypeTemplate.hxx"
#include "NetChartTypeTemplate.hxx"
#include "BubbleChartTypeTemplate.hxx"
+#include <config_features.h>
+#if HAVE_FEATURE_OPENGL
#include "GL3DBarChartTypeTemplate.hxx"
+#endif
#include <cppuhelper/component_context.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/InlineContainer.hxx>
@@ -534,14 +537,16 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
case TEMPLATE_BUBBLE:
xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
break;
-
+#if HAVE_FEATURE_OPENGL
case TEMPLATE_GL3DBAR:
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
break;
case TEMPLATE_GL3DBAR_ROUNDED_RECTANGLE:
xTemplate.set(new GL3DBarChartTypeTemplate(m_xContext, aServiceSpecifier));
break;
-
+#else
+ default: break;
+#endif
// case TEMPLATE_SURFACE:
// case TEMPLATE_ADDIN:
// break;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index fc524b5096e8..c9aba8d841be 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -50,8 +50,9 @@
#include "DateHelper.hxx"
#include "defines.hxx"
#include <unonames.hxx>
+#if HAVE_FEATURE_OPENGL
#include <GL3DBarChart.hxx>
-
+#endif
#include <editeng/frmdiritem.hxx>
#include <rtl/uuid.h>
#include <tools/globname.hxx>
@@ -68,8 +69,9 @@
#include <osl/mutex.hxx>
#include <svx/unofill.hxx>
#include <vcl/openglwin.hxx>
+#if HAVE_FEATURE_OPENGL
#include <vcl/opengl/OpenGLContext.hxx>
-
+#endif
#include <drawinglayer/XShapeDumper.hxx>
#include <time.h>
@@ -1093,8 +1095,10 @@ GL2DRenderer::GL2DRenderer(ChartView* pView):
GL2DRenderer::~GL2DRenderer()
{
SolarMutexGuard g;
+#if HAVE_FEATURE_OPENGL
if(!mbContextDestroyed && mpWindow)
mpWindow->setRenderer(nullptr);
+#endif
mpWindow.reset();
}
@@ -1132,6 +1136,7 @@ void GL2DRenderer::updateOpenGLWindow()
return;
OpenGLWindow* pWindow = mpView->mrChartModel.getOpenGLWindow();
+#if HAVE_FEATURE_OPENGL
if(pWindow != mpWindow)
{
if(mpWindow)
@@ -1144,6 +1149,7 @@ void GL2DRenderer::updateOpenGLWindow()
pWindow->setRenderer(this);
}
}
+#endif
mpWindow = pWindow;
}
@@ -2593,8 +2599,11 @@ void ChartView::impl_refreshAddIn()
bool ChartView::isReal3DChart()
{
uno::Reference< XDiagram > xDiagram( mrChartModel.getFirstDiagram() );
-
+#if HAVE_FEATURE_OPENGL
return ChartHelper::isGL3DDiagram(xDiagram);
+#else
+ return false;
+#endif
}
static const char* envChartDummyFactory = getenv("CHART_DUMMY_FACTORY");
@@ -2637,7 +2646,7 @@ void ChartView::createShapes()
}
pShapeFactory->setPageSize(mxRootShape, aPageSize);
pShapeFactory->clearPage(mxRootShape);
-
+#if HAVE_FEATURE_OPENGL
#if HAVE_FEATURE_DESKTOP
if(isReal3DChart())
{
@@ -2654,6 +2663,7 @@ void ChartView::createShapes()
pWindow->Show(false);
}
#endif
+#endif
createShapes2D(aPageSize);
@@ -2672,6 +2682,7 @@ void ChartView::createShapes()
void ChartView::render()
{
+#if HAVE_FEATURE_OPENGL
if(!isReal3DChart())
{
AbstractShapeFactory* pShapeFactory = AbstractShapeFactory::getOrCreateShapeFactory(m_xShapeFactory);
@@ -2685,6 +2696,7 @@ void ChartView::render()
pShapeFactory->postRender(pWindow);
}
}
+#endif
}
// util::XEventListener (base of XCloseListener)
@@ -3371,6 +3383,7 @@ void ChartView::createShapes3D()
uno::Reference< XChartType > xChartType( aChartTypeList[0] );
+#if HAVE_FEATURE_OPENGL
if (!m_pGL3DPlotter)
{
m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
@@ -3381,6 +3394,7 @@ void ChartView::createShapes3D()
if (pChart)
pChart->setOpenGLWindow(pWindow);
}
+#endif
uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
OSL_ASSERT( xDataSeriesContainer.is());
@@ -3400,9 +3414,11 @@ 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
}
void ChartView::updateOpenGLWindow()