diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-04 12:53:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-05 11:39:20 +0200 |
commit | 31bc29b99c3987949794fa3a17c77928427bff4a (patch) | |
tree | 87e924c668ebebb32a335b9d4eb986f3f392c7a4 /canvas | |
parent | 87e5ee310959d535c53a083258edff1b3b1335bd (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/simplecanvas/simplecanvas.component | 5 | ||||
-rw-r--r-- | 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 @@ --> <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - prefix="simplecanvas" xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.rendering.SimpleCanvas"> + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.rendering.SimpleCanvas" + constructor="com_sun_star_comp_rendering_SimpleCanvas"> <service name="com.sun.star.rendering.SimpleCanvas"/> </implementation> </component> 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 <com/sun/star/rendering/PanoseLetterForm.hpp> #include <com/sun/star/rendering/PanoseWeight.hpp> #include <com/sun/star/rendering/XSimpleCanvas.hpp> -#include <comphelper/servicedecl.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <o3tl/lazy_update.hxx> @@ -37,8 +37,6 @@ #include <functional> -#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_<SimpleCanvasImpl, sdecl::with_args<true> >(), - "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<css::uno::Any> const& args) { - return sdecl::component_getFactoryHelper( pImplName, {&simpleCanvasDecl} ); + return cppu::acquire(new SimpleCanvasImpl(args, context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |