From f4bf7804d5aeb35a9b0c6517997cf079ff770e9e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 2 Oct 2020 14:24:38 +0200 Subject: 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 --- filter/source/config/cache/configflush.cxx | 6 ++---- filter/source/config/cache/filterconfig1.component | 2 +- filter/source/odfflatxml/OdfFlatXml.cxx | 6 ++---- 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 +#include #include -#include 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 const&) { - static rtl::Reference g_Instance(new filter::config::ConfigFlush()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(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 @@ + constructor="filter_ConfigFlush_get_implementation" single-instance="true"> #include #include +#include #include #include -#include #include @@ -197,9 +197,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* filter_OdfFlatXml_get_implementation( css::uno::XComponentContext* context, css::uno::Sequence const&) { - static rtl::Reference g_Instance(new OdfFlatXml(context)); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(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 @@ + constructor="filter_OdfFlatXml_get_implementation" single-instance="true"> -- cgit