[Libreoffice-commits] core.git: canvas/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Jul 5 09:40:02 UTC 2020


 canvas/source/simplecanvas/simplecanvas.component |    5 +++--
 canvas/source/simplecanvas/simplecanvasimpl.cxx   |   19 ++++++-------------
 2 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 31bc29b99c3987949794fa3a17c77928427bff4a
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 4 12:53:13 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 5 11:39:20 2020 +0200

    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 at collabora.co.uk>

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: */


More information about the Libreoffice-commits mailing list