diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 14:20:21 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-10-02 20:42:05 +0200 |
commit | df1fb2f78b4e979d90a3b9b7459c16eb13024a1a (patch) | |
tree | c16a0fbc07d37bf798a914e8f62803ada29a1e4f /scaddins | |
parent | ed3eda5d752b988411616c8cd96953ae6a2fe20f (diff) |
Use the new single-instance="true" attribute in scaddins
Change-Id: Ic20da5a128b9225e688011b556f7927901f344f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103847
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/datefunc/date.component | 2 | ||||
-rw-r--r-- | scaddins/source/datefunc/datefunc.cxx | 6 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.component | 2 | ||||
-rw-r--r-- | scaddins/source/pricing/pricing.cxx | 6 |
4 files changed, 6 insertions, 10 deletions
diff --git a/scaddins/source/datefunc/date.component b/scaddins/source/datefunc/date.component index db67781e1476..7337d98c9388 100644 --- a/scaddins/source/datefunc/date.component +++ b/scaddins/source/datefunc/date.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.sheet.addin.DateFunctionsImpl" - constructor="scaddins_ScaDateAddIn_get_implementation"> + constructor="scaddins_ScaDateAddIn_get_implementation" single-instance="true"> <service name="com.sun.star.sheet.AddIn"/> <service name="com.sun.star.sheet.addin.DateFunctions"/> </implementation> diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx index d4c1921d13f0..995db6235300 100644 --- a/scaddins/source/datefunc/datefunc.cxx +++ b/scaddins/source/datefunc/datefunc.cxx @@ -23,9 +23,9 @@ #include <com/sun/star/util/Date.hpp> #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <rtl/ustrbuf.hxx> -#include <rtl/ref.hxx> #include <unotools/resmgr.hxx> #include <i18nlangtag/languagetag.hxx> #include <algorithm> @@ -91,9 +91,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* scaddins_ScaDateAddIn_get_implementation( css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - static rtl::Reference<ScaDateAddIn> g_Instance(new ScaDateAddIn()); - g_Instance->acquire(); - return static_cast<cppu::OWeakObject*>(g_Instance.get()); + return cppu::acquire(static_cast<cppu::OWeakObject*>(new ScaDateAddIn())); } diff --git a/scaddins/source/pricing/pricing.component b/scaddins/source/pricing/pricing.component index fcee10771c70..fbabf1fb6243 100644 --- a/scaddins/source/pricing/pricing.component +++ b/scaddins/source/pricing/pricing.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.sheet.addin.PricingFunctionsImpl" - constructor="scaddins_ScaPricingAddIn_get_implementation"> + constructor="scaddins_ScaPricingAddIn_get_implementation" single-instance="true"> <service name="com.sun.star.sheet.AddIn"/> <service name="com.sun.star.sheet.addin.PricingFunctions"/> </implementation> diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx index 6cbb13256464..569e396c43da 100644 --- a/scaddins/source/pricing/pricing.cxx +++ b/scaddins/source/pricing/pricing.cxx @@ -29,11 +29,11 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/supportsservice.hxx> +#include <cppuhelper/weak.hxx> #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <iostream> #include <algorithm> #include <rtl/math.hxx> -#include <rtl/ref.hxx> #include <unotools/resmgr.hxx> #include <i18nlangtag/languagetag.hxx> @@ -93,9 +93,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* scaddins_ScaPricingAddIn_get_implementation( css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&) { - static rtl::Reference<ScaPricingAddIn> g_Instance(new ScaPricingAddIn()); - g_Instance->acquire(); - return static_cast<cppu::OWeakObject*>(g_Instance.get()); + return cppu::acquire(static_cast<cppu::OWeakObject*>(new ScaPricingAddIn())); } // "normal" service implementation |