summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-10-02 14:22:55 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-10-02 20:42:52 +0200
commit1be81c0ae66fdb4a92ca9b4fe6691958da838866 (patch)
treeb22acb21334af5f8482b36f0eaf60c114385f8bc /linguistic
parent00d62d03dffd41a923c5920941770d37f52fb6e0 (diff)
Use the new single-instance="true" attribute in linguistic
Change-Id: I87343e3760d3e583fc6b6ad55028e51bd402b536 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103851 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/dlistimp.cxx5
-rw-r--r--linguistic/source/gciterator.cxx6
-rw-r--r--linguistic/source/lng.component8
-rw-r--r--linguistic/source/lngopt.cxx6
-rw-r--r--linguistic/source/lngsvcmgr.cxx5
5 files changed, 12 insertions, 18 deletions
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 03c576a820f4..3fa38b38d4a5 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -26,6 +26,7 @@
#include <tools/urlobj.hxx>
#include <unotools/useroptions.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
#include <unotools/localfilehelper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
@@ -784,9 +785,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
linguistic_DicList_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
{
- static rtl::Reference<DicList> g_Instance(new DicList());
- g_Instance->acquire();
- return static_cast<cppu::OWeakObject*>(g_Instance.get());
+ return cppu::acquire(static_cast<cppu::OWeakObject*>(new DicList()));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 45c13b1cfe72..19864c9d8035 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -48,12 +48,12 @@
#include <osl/conditn.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <rtl/ref.hxx>
#include <map>
@@ -1174,9 +1174,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
linguistic_GrammarCheckingIterator_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
{
- static rtl::Reference<GrammarCheckingIterator> g_Instance(new GrammarCheckingIterator());
- g_Instance->acquire();
- return static_cast<cppu::OWeakObject*>(g_Instance.get());
+ return cppu::acquire(static_cast<cppu::OWeakObject*>(new GrammarCheckingIterator()));
}
diff --git a/linguistic/source/lng.component b/linguistic/source/lng.component
index 525e02cd93e7..82622e2f005f 100644
--- a/linguistic/source/lng.component
+++ b/linguistic/source/lng.component
@@ -24,19 +24,19 @@
<service name="com.sun.star.linguistic2.ConversionDictionaryList"/>
</implementation>
<implementation name="com.sun.star.lingu2.DicList"
- constructor="linguistic_DicList_get_implementation">
+ constructor="linguistic_DicList_get_implementation" single-instance="true">
<service name="com.sun.star.linguistic2.DictionaryList"/>
</implementation>
<implementation name="com.sun.star.lingu2.LinguProps"
- constructor="linguistic_LinguProps_get_implementation">
+ constructor="linguistic_LinguProps_get_implementation" single-instance="true">
<service name="com.sun.star.linguistic2.LinguProperties"/>
</implementation>
<implementation name="com.sun.star.lingu2.LngSvcMgr"
- constructor="linguistic_LngSvcMgr_get_implementation">
+ constructor="linguistic_LngSvcMgr_get_implementation" single-instance="true">
<service name="com.sun.star.linguistic2.LinguServiceManager"/>
</implementation>
<implementation name="com.sun.star.lingu2.ProofreadingIterator"
- constructor="linguistic_GrammarCheckingIterator_get_implementation">
+ constructor="linguistic_GrammarCheckingIterator_get_implementation" single-instance="true">
<service name="com.sun.star.linguistic2.ProofreadingIterator"/>
</implementation>
</component>
diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx
index f82124ecc07a..290b6581f8dc 100644
--- a/linguistic/source/lngopt.cxx
+++ b/linguistic/source/lngopt.cxx
@@ -23,11 +23,11 @@
#include <linguistic/misc.hxx>
#include <tools/debug.hxx>
#include <unotools/lingucfg.hxx>
-#include <rtl/ref.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
@@ -427,9 +427,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
linguistic_LinguProps_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
{
- static rtl::Reference<LinguProps> g_Instance(new LinguProps());
- g_Instance->acquire();
- return static_cast<cppu::OWeakObject*>(g_Instance.get());
+ return cppu::acquire(static_cast<cppu::OWeakObject*>(new LinguProps()));
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 5f25749da164..23a2e2c7cac7 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -42,6 +42,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <cppuhelper/weak.hxx>
#include "lngsvcmgr.hxx"
#include <linguistic/misc.hxx>
@@ -1837,9 +1838,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
linguistic_LngSvcMgr_get_implementation(
css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
{
- static rtl::Reference<LngSvcMgr> g_Instance(new LngSvcMgr());
- g_Instance->acquire();
- return static_cast<cppu::OWeakObject*>(g_Instance.get());
+ return cppu::acquire(static_cast<cppu::OWeakObject*>(new LngSvcMgr()));
}