summaryrefslogtreecommitdiffstats
path: root/canvas
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-07-23 18:12:02 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-07-24 10:46:27 +0200
commit71654aed66ef425467118b69bc6d5879b4b0e717 (patch)
tree15f6461b88794ccffdc773dfb0f0b463ce3a9852 /canvas
parentNumericField is unused (diff)
downloadcore-71654aed66ef425467118b69bc6d5879b4b0e717.tar.gz
core-71654aed66ef425467118b69bc6d5879b4b0e717.zip
tdf#135078: let vclcanvas::SpriteCanvas implement css::lang::XServiceInfo
In Skia mode, OGLTransitionerImpl::initWindowFromSlideShowView obtains vclcanvas::SpriteCanvas from passed xView; it's passed to getDeviceInfo, which needs a css::lang::XServiceInfo to fill the device params sequence. vclcanvas::SpriteCanvas did not implement it, the sequence stayed empty, and dereferencing its elements later crashed. When Skia is disabled (VCL:win), xView provides a dxcanvas::SpriteCanvas instead, which implements css::lang::XServiceInfo. This makes vclcanvas::SpriteCanvas implement css::lang::XServiceInfo. I don't know if it's better to find out why vclcanvas::SpriteCanvas is used in Skia mode, and not dxcanvas::SpriteCanvas. Change-Id: Ic0ab1323772161052a23946cfcc91e656ba6685c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99330 Reviewed-by: Luboš Luňák <l.lunak@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/spritecanvas.cxx15
-rw-r--r--canvas/source/vcl/spritecanvas.hxx9
2 files changed, 23 insertions, 1 deletions
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index a82bf0d4db18..bc3b2d9f290a 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -21,6 +21,7 @@
#include <sal/log.hxx>
#include <com/sun/star/awt/XTopWindow.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <tools/diagnose_ex.h>
#include "spritecanvas.hxx"
@@ -131,6 +132,20 @@ namespace vclcanvas
return "com.sun.star.rendering.SpriteCanvas.VCL";
}
+ // XServiceInfo
+ css::uno::Sequence<OUString> SpriteCanvas::getSupportedServiceNames()
+ {
+ return { SpriteCanvas::getServiceName() };
+ }
+ OUString SpriteCanvas::getImplementationName()
+ {
+ return "com.sun.star.comp.rendering.SpriteCanvas.VCL";
+ }
+ sal_Bool SpriteCanvas::supportsService(const OUString& sServiceName)
+ {
+ return cppu::supportsService(this, sServiceName);
+ }
+
bool SpriteCanvas::repaint( const GraphicObjectSharedPtr& rGrf,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState,
diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx
index 06c70faca2c3..05897741d9ab 100644
--- a/canvas/source/vcl/spritecanvas.hxx
+++ b/canvas/source/vcl/spritecanvas.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
#include <com/sun/star/awt/XWindowListener.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
@@ -56,7 +57,8 @@ namespace vclcanvas
css::awt::XWindowListener,
css::util::XUpdatable,
css::beans::XPropertySet,
- css::lang::XServiceName > WindowGraphicDeviceBase_Base;
+ css::lang::XServiceName,
+ css::lang::XServiceInfo > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
SpriteDeviceHelper,
tools::LocalGuard,
@@ -132,6 +134,11 @@ namespace vclcanvas
// XServiceName
virtual OUString SAL_CALL getServiceName( ) override;
+ // XServiceInfo
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString&) override;
+
// RepaintTarget
virtual bool repaint( const GraphicObjectSharedPtr& rGrf,
const css::rendering::ViewState& viewState,