[Libreoffice-commits] core.git: drawinglayer/drawinglayer.component drawinglayer/Library_drawinglayer.mk drawinglayer/source solenv/bin

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 7 09:57:21 UTC 2020


 drawinglayer/Library_drawinglayer.mk                         |    1 
 drawinglayer/drawinglayer.component                          |    5 -
 drawinglayer/source/drawinglayeruno/drawinglayeruno.cxx      |   55 -----------
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx |   41 ++------
 drawinglayer/source/drawinglayeruno/xprimitive2drenderer.hxx |   49 ---------
 solenv/bin/native-code.py                                    |    3 
 6 files changed, 16 insertions(+), 138 deletions(-)

New commits:
commit 125f3c4c930bd28a42c6819417b11b885e4586fc
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Jul 6 18:46:12 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 7 11:56:41 2020 +0200

    drawinglayer: create instances with uno constructors
    
    See tdf#74608 for motivation
    
    Change-Id: I38de5ec7b9e376ef8868bebbe7f30240de81c241
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98219
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk
index 24b8055836d0..43a42b83b42c 100644
--- a/drawinglayer/Library_drawinglayer.mk
+++ b/drawinglayer/Library_drawinglayer.mk
@@ -187,7 +187,6 @@ $(eval $(call gb_Library_add_exception_objects,drawinglayer,\
     drawinglayer/source/tools/emfpcustomlinecap \
     drawinglayer/source/tools/wmfemfhelper \
     drawinglayer/source/tools/primitive2dxmldump \
-    drawinglayer/source/drawinglayeruno/drawinglayeruno \
     drawinglayer/source/drawinglayeruno/xprimitive2drenderer \
     drawinglayer/source/texture/texture \
     drawinglayer/source/dumper/XShapeDumper \
diff --git a/drawinglayer/drawinglayer.component b/drawinglayer/drawinglayer.component
index 146df69790b5..0b35eab47b83 100644
--- a/drawinglayer/drawinglayer.component
+++ b/drawinglayer/drawinglayer.component
@@ -18,8 +18,9 @@
 -->
 
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
-    prefix="drawinglayer" xmlns="http://openoffice.org/2010/uno-components">
-  <implementation name="drawinglayer::unorenderer::XPrimitive2DRenderer">
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="drawinglayer::unorenderer::XPrimitive2DRenderer"
+    constructor="drawinglayer_XPrimitive2DRenderer">
     <service name="com.sun.star.graphic.Primitive2DTools"/>
   </implementation>
 </component>
diff --git a/drawinglayer/source/drawinglayeruno/drawinglayeruno.cxx b/drawinglayer/source/drawinglayeruno/drawinglayeruno.cxx
deleted file mode 100644
index 52438318e77f..000000000000
--- a/drawinglayer/source/drawinglayeruno/drawinglayeruno.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <com/sun/star/uno/Reference.h>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <cppuhelper/factory.hxx>
-
-#include "xprimitive2drenderer.hxx"
-
-using namespace ::com::sun::star;
-
-extern "C"
-{
-    SAL_DLLPUBLIC_EXPORT void* drawinglayer_component_getFactory( const char* pImplName, void* pServiceManager, void* /* pRegistryKey */ )
-    {
-        uno::Reference< lang::XSingleServiceFactory > xFactory;
-        void* pRet = nullptr;
-
-        if(drawinglayer::unorenderer::XPrimitive2DRenderer_getImplementationName().equalsAscii(pImplName))
-        {
-            xFactory = ::cppu::createSingleFactory(
-                static_cast< lang::XMultiServiceFactory * >(pServiceManager),
-                drawinglayer::unorenderer::XPrimitive2DRenderer_getImplementationName(),
-                drawinglayer::unorenderer::XPrimitive2DRenderer_createInstance,
-                drawinglayer::unorenderer::XPrimitive2DRenderer_getSupportedServiceNames());
-        }
-
-        if(xFactory.is())
-        {
-            xFactory->acquire();
-            pRet = xFactory.get();
-        }
-
-        return pRet;
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
index e4708c4131b4..66b29591df7e 100644
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
+++ b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.cxx
@@ -20,8 +20,8 @@
 #include <sal/config.h>
 
 #include <com/sun/star/graphic/XPrimitive2DRenderer.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <cppuhelper/implbase2.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <comphelper/sequence.hxx>
@@ -35,8 +35,6 @@
 
 #include <converters.hxx>
 
-#include "xprimitive2drenderer.hxx"
-
 using namespace ::com::sun::star;
 
 
@@ -70,32 +68,7 @@ namespace drawinglayer::unorenderer
         };
 
         }
-} // end of namespace drawinglayer::unorenderer
-
-
-// uno functions
-
-namespace drawinglayer::unorenderer
-{
-        uno::Sequence< OUString > XPrimitive2DRenderer_getSupportedServiceNames()
-        {
-            return { "com.sun.star.graphic.Primitive2DTools" };
-        }
-
-        OUString XPrimitive2DRenderer_getImplementationName()
-        {
-            return "drawinglayer::unorenderer::XPrimitive2DRenderer";
-        }
-
-        uno::Reference< uno::XInterface > XPrimitive2DRenderer_createInstance(const uno::Reference< lang::XMultiServiceFactory >&)
-        {
-            return static_cast< ::cppu::OWeakObject* >(new XPrimitive2DRenderer);
-        }
-} // end of namespace drawinglayer::unorenderer
-
 
-namespace drawinglayer::unorenderer
-{
         XPrimitive2DRenderer::XPrimitive2DRenderer()
         {
         }
@@ -175,7 +148,7 @@ namespace drawinglayer::unorenderer
 
         OUString SAL_CALL XPrimitive2DRenderer::getImplementationName()
         {
-            return XPrimitive2DRenderer_getImplementationName();
+            return "drawinglayer::unorenderer::XPrimitive2DRenderer";
         }
 
         sal_Bool SAL_CALL XPrimitive2DRenderer::supportsService(const OUString& rServiceName)
@@ -185,9 +158,17 @@ namespace drawinglayer::unorenderer
 
         uno::Sequence< OUString > SAL_CALL XPrimitive2DRenderer::getSupportedServiceNames()
         {
-            return XPrimitive2DRenderer_getSupportedServiceNames();
+            return { "com.sun.star.graphic.Primitive2DTools" };
         }
 
 } // end of namespace
 
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+drawinglayer_XPrimitive2DRenderer(
+    css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const& )
+{
+    return cppu::acquire(new drawinglayer::unorenderer::XPrimitive2DRenderer());
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.hxx b/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.hxx
deleted file mode 100644
index ba18f9ba3096..000000000000
--- a/drawinglayer/source/drawinglayeruno/xprimitive2drenderer.hxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_DRAWINGLAYER_SOURCE_DRAWINGLAYERUNO_XPRIMITIVE2DRENDERER_HXX
-#define INCLUDED_DRAWINGLAYER_SOURCE_DRAWINGLAYERUNO_XPRIMITIVE2DRENDERER_HXX
-
-#include <sal/config.h>
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <rtl/ustring.hxx>
-
-namespace com::sun::star {
-    namespace lang { class XMultiServiceFactory; }
-    namespace uno { class XInterface; }
-}
-
-namespace drawinglayer::unorenderer {
-
-css::uno::Sequence<OUString>
-XPrimitive2DRenderer_getSupportedServiceNames();
-
-OUString XPrimitive2DRenderer_getImplementationName();
-
-css::uno::Reference<css::uno::XInterface>
-XPrimitive2DRenderer_createInstance(
-    css::uno::Reference<css::lang::XMultiServiceFactory> const &);
-
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 43da9246a3c5..d9d50e81103d 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -22,7 +22,6 @@ import xml.etree.ElementTree as ET
 core_factory_list = [
     ("libembobj.a", "embobj_component_getFactory"),
     ("libevtattlo.a", "evtatt_component_getFactory"),
-    ("libdrawinglayerlo.a", "drawinglayer_component_getFactory"),
     ("libfilterconfiglo.a", "filterconfig1_component_getFactory"),
     ("libfsstoragelo.a", "fsstorage_component_getFactory"),
     ("libhyphenlo.a", "hyphen_component_getFactory"),
@@ -148,6 +147,8 @@ core_constructor_list = [
     "com_sun_star_cui_ColorPicker_get_implementation",
 # dbaccess/util/dba.component
     "com_sun_star_comp_dba_ORowSet_get_implementation",
+# drawinglayer/drawinglayer.component
+    "drawinglayer_XPrimitive2DRenderer",
 # emfio/emfio.component
     "emfio_emfreader_XEmfParser_get_implementation",
 # extensions/source/logging/log.component


More information about the Libreoffice-commits mailing list