diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 14:24:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 20:44:25 +0200 |
commit | f4bf7804d5aeb35a9b0c6517997cf079ff770e9e (patch) | |
tree | e9128a939e57aa462985addc17c9da48c5f7dc9b | |
parent | a2b256df787e76c90c110f363cf7a3b84b54947f (diff) |
Use the new single-instance="true" attribute in filter
Change-Id: Id9a77324a30dec155e77616378690c47cb86536b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103853
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | filter/source/config/cache/configflush.cxx | 6 | ||||
-rw-r--r-- | filter/source/config/cache/filterconfig1.component | 2 | ||||
-rw-r--r-- | filter/source/odfflatxml/OdfFlatXml.cxx | 6 | ||||
-rw-r--r-- | filter/source/odfflatxml/odfflatxml.component | 2 |
4 files changed, 6 insertions, 10 deletions
diff --git a/filter/source/config/cache/configflush.cxx b/filter/source/config/cache/configflush.cxx index e0c4ca58f641..f3f114b90ca2 100644 --- a/filter/source/config/cache/configflush.cxx +++ b/filter/source/config/cache/configflush.cxx @@ -19,8 +19,8 @@ #include "configflush.hxx" #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <com/sun/star/uno/XComponentContext.hpp> -#include <rtl/ref.hxx> namespace filter::config{ @@ -107,9 +107,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* filter_ConfigFlush_get_implementation( css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - static rtl::Reference<filter::config::ConfigFlush> g_Instance(new filter::config::ConfigFlush()); - g_Instance->acquire(); - return static_cast<cppu::OWeakObject*>(g_Instance.get()); + return cppu::acquire(static_cast<cppu::OWeakObject*>(new filter::config::ConfigFlush())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/config/cache/filterconfig1.component b/filter/source/config/cache/filterconfig1.component index 9597348890ee..711c0e38f781 100644 --- a/filter/source/config/cache/filterconfig1.component +++ b/filter/source/config/cache/filterconfig1.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.filter.config.ConfigFlush" - constructor="filter_ConfigFlush_get_implementation"> + constructor="filter_ConfigFlush_get_implementation" single-instance="true"> <service name="com.sun.star.document.FilterConfigRefresh"/> </implementation> <implementation name="com.sun.star.comp.filter.config.ContentHandlerFactory" diff --git a/filter/source/odfflatxml/OdfFlatXml.cxx b/filter/source/odfflatxml/OdfFlatXml.cxx index 2846de1441ed..4894887ce140 100644 --- a/filter/source/odfflatxml/OdfFlatXml.cxx +++ b/filter/source/odfflatxml/OdfFlatXml.cxx @@ -12,9 +12,9 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <osl/diagnose.h> #include <sal/log.hxx> -#include <rtl/ref.hxx> #include <sax/tools/documenthandleradapter.hxx> @@ -197,9 +197,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* filter_OdfFlatXml_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&) { - static rtl::Reference<OdfFlatXml> g_Instance(new OdfFlatXml(context)); - g_Instance->acquire(); - return static_cast<cppu::OWeakObject*>(g_Instance.get()); + return cppu::acquire(static_cast<cppu::OWeakObject*>(new OdfFlatXml(context))); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/odfflatxml/odfflatxml.component b/filter/source/odfflatxml/odfflatxml.component index 273ff4582d54..5f8bcfa9da28 100644 --- a/filter/source/odfflatxml/odfflatxml.component +++ b/filter/source/odfflatxml/odfflatxml.component @@ -10,7 +10,7 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" xmlns="http://openoffice.org/2010/uno-components"> <implementation name="com.sun.star.comp.filter.OdfFlatXml" - constructor="filter_OdfFlatXml_get_implementation"> + constructor="filter_OdfFlatXml_get_implementation" single-instance="true"> <service name="com.sun.star.document.ImportFilter"/> <service name="com.sun.star.document.ExportFilter"/> </implementation> |