From 31bc29b99c3987949794fa3a17c77928427bff4a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 4 Jul 2020 12:53:13 +0200 Subject: canvas/simple: create instances with uno constructors See tdf#74608 for motivation Change-Id: I2635df49edc2124f41a557110332ce5646cc59ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98093 Tested-by: Jenkins Reviewed-by: Noel Grandin --- canvas/source/simplecanvas/simplecanvas.component | 5 +++-- canvas/source/simplecanvas/simplecanvasimpl.cxx | 19 ++++++------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/canvas/source/simplecanvas/simplecanvas.component b/canvas/source/simplecanvas/simplecanvas.component index 2fe54c391ab2..9be11ad47952 100644 --- a/canvas/source/simplecanvas/simplecanvas.component +++ b/canvas/source/simplecanvas/simplecanvas.component @@ -18,8 +18,9 @@ --> - + xmlns="http://openoffice.org/2010/uno-components"> + diff --git a/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx index 902c2c6a03d2..c9b87265d1d6 100644 --- a/canvas/source/simplecanvas/simplecanvasimpl.cxx +++ b/canvas/source/simplecanvas/simplecanvasimpl.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -37,8 +37,6 @@ #include -#define SERVICE_NAME "com.sun.star.rendering.SimpleCanvas" - using namespace ::com::sun::star; using namespace canvas; @@ -171,7 +169,7 @@ namespace // Ifc XServiceName virtual OUString SAL_CALL getServiceName( ) override { - return SERVICE_NAME; + return "com.sun.star.rendering.SimpleCanvas"; } // Ifc XSimpleCanvas @@ -365,18 +363,13 @@ namespace SimpleRenderState maRenderState; }; - namespace sdecl = comphelper::service_decl; - const sdecl::ServiceDecl simpleCanvasDecl( - sdecl::class_ >(), - "com.sun.star.comp.rendering.SimpleCanvas", - SERVICE_NAME ); } -// The C shared lib entry points -extern "C" SAL_DLLPUBLIC_EXPORT void* simplecanvas_component_getFactory( char const* pImplName, - void*, void* ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_rendering_SimpleCanvas( + css::uno::XComponentContext* context, css::uno::Sequence const& args) { - return sdecl::component_getFactoryHelper( pImplName, {&simpleCanvasDecl} ); + return cppu::acquire(new SimpleCanvasImpl(args, context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3