Use the new single-instance="true" attribute in embeddedobj

Change-Id: Icead3bb5715a08bc2a2dfbb16c074d1b19e316a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103855
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2020-10-02 14:26:51 +02:00
parent cf7638fd05
commit a2b256df78
7 changed files with 21 additions and 22 deletions

View File

@ -24,6 +24,7 @@
#include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/io/IOException.hpp> #include <com/sun/star/io/IOException.hpp>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/documentconstants.hxx> #include <comphelper/documentconstants.hxx>
#include "xfactory.hxx" #include "xfactory.hxx"
@ -367,9 +368,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
embeddedobj_OOoEmbeddedObjectFactory_get_implementation( embeddedobj_OOoEmbeddedObjectFactory_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{ {
static rtl::Reference<OOoEmbeddedObjectFactory> g_Instance(new OOoEmbeddedObjectFactory(context)); return cppu::acquire(static_cast<cppu::OWeakObject*>(new OOoEmbeddedObjectFactory(context)));
g_Instance->acquire();
return static_cast<cppu::OWeakObject*>(g_Instance.get());
} }
@ -413,8 +412,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
embeddedobj_OOoSpecialEmbeddedObjectFactory_get_implementation( embeddedobj_OOoSpecialEmbeddedObjectFactory_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{ {
static rtl::Reference<OOoSpecialEmbeddedObjectFactory> g_Instance(new OOoSpecialEmbeddedObjectFactory(context)); return cppu::acquire(static_cast<cppu::OWeakObject*>(new OOoSpecialEmbeddedObjectFactory(context)));
g_Instance->acquire();
return static_cast<cppu::OWeakObject*>(g_Instance.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -28,9 +28,9 @@
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
#include <comphelper/documentconstants.hxx> #include <comphelper/documentconstants.hxx>
#include <officecfg/Office/Common.hxx> #include <officecfg/Office/Common.hxx>
#include <rtl/ref.hxx>
#include <xcreator.hxx> #include <xcreator.hxx>
#include <dummyobject.hxx> #include <dummyobject.hxx>
@ -410,9 +410,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
embeddedobj_UNOEmbeddedObjectCreator_get_implementation( embeddedobj_UNOEmbeddedObjectCreator_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{ {
static rtl::Reference<UNOEmbeddedObjectCreator> g_Instance(new UNOEmbeddedObjectCreator(context)); return cppu::acquire(static_cast<cppu::OWeakObject*>(new UNOEmbeddedObjectCreator(context)));
g_Instance->acquire();
return static_cast<cppu::OWeakObject*>(g_Instance.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -20,7 +20,8 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components"> xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory" <implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"
constructor="embeddedobj_OleEmbeddedObjectFactory_get_implementation"> constructor="embeddedobj_OleEmbeddedObjectFactory_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/> <service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/>
<service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/> <service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/>
</implementation> </implementation>

View File

@ -20,12 +20,14 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components"> xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.MSOLEObjectSystemCreator" <implementation name="com.sun.star.comp.embed.MSOLEObjectSystemCreator"
constructor="embeddedobj_MSOLEDialogObjectCreator_get_implementation"> constructor="embeddedobj_MSOLEDialogObjectCreator_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.MSOLEObjectSystemCreator"/> <service name="com.sun.star.comp.embed.MSOLEObjectSystemCreator"/>
<service name="com.sun.star.embed.MSOLEObjectSystemCreator"/> <service name="com.sun.star.embed.MSOLEObjectSystemCreator"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory" <implementation name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"
constructor="embeddedobj_OleEmbeddedObjectFactory_get_implementation"> constructor="embeddedobj_OleEmbeddedObjectFactory_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/> <service name="com.sun.star.comp.embed.OLEEmbeddedObjectFactory"/>
<service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/> <service name="com.sun.star.embed.OLEEmbeddedObjectFactory"/>
</implementation> </implementation>

View File

@ -35,6 +35,7 @@
#include <comphelper/mimeconfighelper.hxx> #include <comphelper/mimeconfighelper.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
#include "xdialogcreator.hxx" #include "xdialogcreator.hxx"
#include <oleembobj.hxx> #include <oleembobj.hxx>
@ -323,9 +324,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
embeddedobj_MSOLEDialogObjectCreator_get_implementation( embeddedobj_MSOLEDialogObjectCreator_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{ {
static rtl::Reference<MSOLEDialogObjectCreator> g_Instance(new MSOLEDialogObjectCreator(context)); return cppu::acquire(static_cast<cppu::OWeakObject*>(new MSOLEDialogObjectCreator(context)));
g_Instance->acquire();
return static_cast<cppu::OWeakObject*>(g_Instance.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -28,6 +28,7 @@
#include <oleembobj.hxx> #include <oleembobj.hxx>
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/weak.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
@ -244,9 +245,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
embeddedobj_OleEmbeddedObjectFactory_get_implementation( embeddedobj_OleEmbeddedObjectFactory_get_implementation(
css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{ {
static rtl::Reference<OleEmbeddedObjectFactory> g_Instance(new OleEmbeddedObjectFactory(context)); return cppu::acquire(static_cast<cppu::OWeakObject*>(new OleEmbeddedObjectFactory(context)));
g_Instance->acquire();
return static_cast<cppu::OWeakObject*>(g_Instance.get());
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -20,17 +20,20 @@
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
xmlns="http://openoffice.org/2010/uno-components"> xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.embed.EmbeddedObjectCreator" <implementation name="com.sun.star.comp.embed.EmbeddedObjectCreator"
constructor="embeddedobj_UNOEmbeddedObjectCreator_get_implementation"> constructor="embeddedobj_UNOEmbeddedObjectCreator_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.EmbeddedObjectCreator"/> <service name="com.sun.star.comp.embed.EmbeddedObjectCreator"/>
<service name="com.sun.star.embed.EmbeddedObjectCreator"/> <service name="com.sun.star.embed.EmbeddedObjectCreator"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory" <implementation name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory"
constructor="embeddedobj_OOoEmbeddedObjectFactory_get_implementation"> constructor="embeddedobj_OOoEmbeddedObjectFactory_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory"/> <service name="com.sun.star.comp.embed.OOoEmbeddedObjectFactory"/>
<service name="com.sun.star.embed.OOoEmbeddedObjectFactory"/> <service name="com.sun.star.embed.OOoEmbeddedObjectFactory"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory" <implementation name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"
constructor="embeddedobj_OOoSpecialEmbeddedObjectFactory_get_implementation"> constructor="embeddedobj_OOoSpecialEmbeddedObjectFactory_get_implementation"
single-instance="true">
<service name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"/> <service name="com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"/>
<service name="com.sun.star.embed.OOoSpecialEmbeddedObjectFactory"/> <service name="com.sun.star.embed.OOoSpecialEmbeddedObjectFactory"/>
</implementation> </implementation>