From cf7638fd051773efcc78ea9610030354d4d15665 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 2 Oct 2020 14:23:42 +0200 Subject: Use the new single-instance="true" attribute in lingucomponent Change-Id: I802ee5ac618aa706b126630c8bb4e7e2e83c59f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103852 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- lingucomponent/source/hyphenator/hyphen/hyphen.component | 2 +- lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 5 ++--- lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.component | 2 +- lingucomponent/source/spellcheck/macosxspell/macspellimp.mm | 5 ++--- lingucomponent/source/spellcheck/spell/spell.component | 2 +- lingucomponent/source/spellcheck/spell/sspellimp.cxx | 5 ++--- lingucomponent/source/thesaurus/libnth/lnth.component | 2 +- lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 5 ++--- 8 files changed, 12 insertions(+), 16 deletions(-) (limited to 'lingucomponent') diff --git a/lingucomponent/source/hyphenator/hyphen/hyphen.component b/lingucomponent/source/hyphenator/hyphen/hyphen.component index 0d775423dd5c..b9bc8b1f36ca 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphen.component +++ b/lingucomponent/source/hyphenator/hyphen/hyphen.component @@ -20,7 +20,7 @@ + constructor="lingucomponent_Hyphenator_get_implementation" single-instance="true"> diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 8c7d09ac66e6..988306757a96 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -803,9 +804,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* lingucomponent_Hyphenator_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new Hyphenator()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(new Hyphenator())); } diff --git a/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.component b/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.component index f318df2abfec..b1fe7d612aa8 100644 --- a/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.component +++ b/lingucomponent/source/spellcheck/macosxspell/MacOSXSpell.component @@ -20,7 +20,7 @@ + constructor="lingucomponent_MacSpellChecker_get_implementation" single-instance="true"> diff --git a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm index c3f64635e071..74b365c71746 100644 --- a/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm +++ b/lingucomponent/source/spellcheck/macosxspell/macspellimp.mm @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -634,9 +635,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* lingucomponent_MacSpellChecker_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new MacSpellChecker()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(new MacSpellChecker())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/lingucomponent/source/spellcheck/spell/spell.component b/lingucomponent/source/spellcheck/spell/spell.component index 59f634eab02a..c284e13fc3a7 100644 --- a/lingucomponent/source/spellcheck/spell/spell.component +++ b/lingucomponent/source/spellcheck/spell/spell.component @@ -20,7 +20,7 @@ + constructor="lingucomponent_SpellChecker_get_implementation" single-instance="true"> diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx index 23bd9e014c29..051b29c60d4e 100644 --- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx +++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -635,9 +636,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* lingucomponent_SpellChecker_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new SpellChecker()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(new SpellChecker())); } diff --git a/lingucomponent/source/thesaurus/libnth/lnth.component b/lingucomponent/source/thesaurus/libnth/lnth.component index dfe3d3300cbc..66e90e2cf231 100644 --- a/lingucomponent/source/thesaurus/libnth/lnth.component +++ b/lingucomponent/source/thesaurus/libnth/lnth.component @@ -20,7 +20,7 @@ + constructor="lingucomponent_Thesaurus_get_implementation" single-instance="true"> diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx index a8b32bd4727f..2c9bfb196917 100644 --- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx +++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -570,9 +571,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* lingucomponent_Thesaurus_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new Thesaurus()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(new Thesaurus())); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit