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

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 20:30:35 UTC 2020


 eventattacher/source/eventattacher.cxx |    5 +----
 eventattacher/source/evtatt.component  |    2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 95969a80308dbe672b387b17ec6beff60fa2efef
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 2 14:25:15 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Oct 2 22:29:54 2020 +0200

    Use the new single-instance="true" attribute in eventattacher
    
    Change-Id: Iea414a641d252f7af40ebcabb6f11222fe81dd45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103854
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 4099c1bc64fb..48dac12a3a95 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -40,7 +40,6 @@
 #include <cppuhelper/factory.hxx>
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/supportsservice.hxx>
-#include <rtl/ref.hxx>
 
 namespace com::sun::star::lang { class XMultiServiceFactory; }
 
@@ -843,9 +842,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
 eventattacher_EventAttacher(
     css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& )
 {
-    static rtl::Reference<comp_EventAttacher::EventAttacherImpl> instance(new comp_EventAttacher::EventAttacherImpl(context));
-    instance->acquire();
-    return static_cast<cppu::OWeakObject*>(instance.get());
+    return cppu::acquire(static_cast<cppu::OWeakObject*>(new comp_EventAttacher::EventAttacherImpl(context)));
 }
 
 
diff --git a/eventattacher/source/evtatt.component b/eventattacher/source/evtatt.component
index 40389217c039..8d51ca1dee7a 100644
--- a/eventattacher/source/evtatt.component
+++ b/eventattacher/source/evtatt.component
@@ -20,7 +20,7 @@
 <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
     xmlns="http://openoffice.org/2010/uno-components">
   <implementation name="com.sun.star.comp.EventAttacher"
-    constructor="eventattacher_EventAttacher">
+    constructor="eventattacher_EventAttacher" single-instance="true">
     <service name="com.sun.star.script.EventAttacher"/>
   </implementation>
 </component>


More information about the Libreoffice-commits mailing list