[Libreoffice-commits] core.git: 2 commits - chart2/source vcl/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Sun Jun 1 08:26:46 PDT 2014
chart2/source/view/inc/AbstractShapeFactory.hxx | 4 ++--
chart2/source/view/inc/OpenglShapeFactory.hxx | 4 ++--
chart2/source/view/inc/ShapeFactory.hxx | 4 ++--
chart2/source/view/main/ChartView.cxx | 4 ++--
chart2/source/view/main/OpenglShapeFactory.cxx | 6 ++----
vcl/source/window/openglwin.cxx | 12 ++++++++----
6 files changed, 18 insertions(+), 16 deletions(-)
New commits:
commit e7da55b6ed9ac288eb8075ce169a9c1e305f7d99
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jun 1 17:12:32 2014 +0200
make the OpenglShapeFactory work with the new OpenGLWindow impl
Change-Id: Id97a61c67b55d6ef85b9752f7f4ac2c93aa5bf32
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 8d5fdc6..d95b906 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -239,12 +239,12 @@ public:
/**
* Only necessary for stateless implementations
*/
- virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage) = 0;
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
virtual bool preRender(OpenGLWindow* pWindow) = 0;
virtual void postRender(OpenGLWindow* pWindow) = 0;
- virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage) = 0;
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
getChartRootShape( const ::com::sun::star::uno::Reference<
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index 97f1955..63fc02b 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -184,12 +184,12 @@ public:
virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize ) SAL_OVERRIDE;
- virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage) SAL_OVERRIDE;
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xDrawPage) SAL_OVERRIDE;
virtual bool preRender(OpenGLWindow* pWindow) SAL_OVERRIDE;
virtual void postRender(OpenGLWindow* pWindow) SAL_OVERRIDE;
- virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > xDrawPage) SAL_OVERRIDE;
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xDrawPage) SAL_OVERRIDE;
};
}
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index c427c38..171daad 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -197,12 +197,12 @@ public:
/**
* not necessary right now
*/
- virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > ) SAL_OVERRIDE {}
+ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
virtual bool preRender(OpenGLWindow*) SAL_OVERRIDE { return true; }
virtual void postRender(OpenGLWindow*) SAL_OVERRIDE {}
- virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > ) SAL_OVERRIDE {}
+ virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
private:
ShapeFactory();
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 7b71206..a2355df 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2451,7 +2451,7 @@ void ChartView::createShapes()
OSL_FAIL("could not set page size correctly");
}
pShapeFactory->setPageSize(mxRootShape, aPageSize);
- pShapeFactory->clearPage(m_xDrawPage);
+ pShapeFactory->clearPage(mxRootShape);
#if HAVE_FEATURE_DESKTOP
if(isReal3DChart())
@@ -2619,7 +2619,7 @@ void ChartView::createShapes()
bool bRender = pShapeFactory->preRender(pWindow);
if(bRender)
{
- pShapeFactory->render(m_xDrawPage);
+ pShapeFactory->render(mxRootShape);
pShapeFactory->postRender(pWindow);
}
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index 7616cd0..ae3223e 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -447,9 +447,8 @@ uno::Reference< drawing::XShape >
return pText;
}
-void OpenglShapeFactory::render(uno::Reference< drawing::XDrawPage > xDrawPage)
+void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape)
{
- uno::Reference< drawing::XShapes > xRootShape = getChartShape(xDrawPage);
dummy::DummyChart* pChart = dynamic_cast<dummy::DummyChart*>(xRootShape.get());
assert(pChart);
pChart->render();
@@ -472,9 +471,8 @@ void OpenglShapeFactory::postRender(OpenGLWindow* pWindow)
pWindow->getContext()->swapBuffers();
}
-void OpenglShapeFactory::clearPage(uno::Reference< drawing::XDrawPage > xDrawPage)
+void OpenglShapeFactory::clearPage(uno::Reference< drawing::XShapes > xRootShape)
{
- uno::Reference< drawing::XShapes > xRootShape = getChartShape(xDrawPage);
dummy::DummyChart* pChart = dynamic_cast<dummy::DummyChart*>(xRootShape.get());
assert(pChart);
pChart->clear();
commit 8d83c439bacb3155eec31fe3b4bf2c9990beb936
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Sun Jun 1 17:10:42 2014 +0200
fix crash if there is no OpenGLRenderer set
Change-Id: I6cd75aa2a9db7219b2873d0b6516ef9df4fbe33d
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index 0300987..f7b3cf3 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -65,13 +65,15 @@ void OpenGLWindow::MouseButtonDown( const MouseEvent& rMEvt )
void OpenGLWindow::MouseButtonUp( const MouseEvent& rMEvt )
{
+ if(!mpRenderer)
+ return;
+
Point aPoint = rMEvt.GetPosPixel();
if(aPoint == maStartPoint)
{
Color aColor = GetPixel(aPoint);
SAL_WARN("vcl.opengl", aColor.GetColor());
- if(mpRenderer)
- mpRenderer->clickedAt(aPoint, rMEvt.GetButtons());
+ mpRenderer->clickedAt(aPoint, rMEvt.GetButtons());
}
else
{
@@ -82,14 +84,16 @@ void OpenGLWindow::MouseButtonUp( const MouseEvent& rMEvt )
void OpenGLWindow::Command( const CommandEvent& rCEvt )
{
+ if(!mpRenderer)
+ return;
+
if(rCEvt.GetCommand() == COMMAND_WHEEL)
{
const CommandWheelData* pData = rCEvt.GetWheelData();
if(pData->GetMode() == COMMAND_WHEEL_SCROLL)
{
long nDelta = pData->GetDelta();
- if(mpRenderer)
- mpRenderer->scroll(nDelta);
+ mpRenderer->scroll(nDelta);
}
}
}
More information about the Libreoffice-commits
mailing list