From ed52d1eb0aaceed3aae1c182091401f9c433acdd Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 24 May 2021 15:25:09 +0100 Subject: adapt oglcanvas::SpriteDeviceHelper::getDeviceHandle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit to match the other implementations that return the OutputDevice* I tried enabling SpriteCanvas.OGL in officecfg/registry/data/org/openoffice/Office/Canvas.xcu with com.sun.star.comp.rendering.SpriteCanvas.DX9, - com.sun.star.comp.rendering.SpriteCanvas.Cairo, + com.sun.star.comp.rendering.SpriteCanvas.OGL, com.sun.star.comp.rendering.SpriteCanvas.VCL but it crashes before it gets very far and before it gets to this method. I tried in 7.1 and 7.0 but the same result so I can't tell if this fix is needed, but they surely should be the same as the others. Change-Id: I4f3715568eb0ec3a3bc57f6e6bdf158ff530ca5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116061 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- canvas/source/opengl/ogl_spritedevicehelper.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index 7e838162e6c3..553798aa9fd9 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -342,7 +342,8 @@ namespace oglcanvas uno::Any SpriteDeviceHelper::getDeviceHandle() const { const SystemChildWindow* pChildWindow = mxContext->getChildWindow(); - return uno::Any( reinterpret_cast< sal_Int64 >(pChildWindow) ); + const OutputDevice* pDevice = pChildWindow ? pChildWindow->GetOutDev() : nullptr; + return uno::Any(reinterpret_cast(pDevice)); } uno::Any SpriteDeviceHelper::getSurfaceHandle() const -- cgit