From df1fb2f78b4e979d90a3b9b7459c16eb13024a1a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 2 Oct 2020 14:20:21 +0200 Subject: 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 --- scaddins/source/datefunc/date.component | 2 +- scaddins/source/datefunc/datefunc.cxx | 6 ++---- scaddins/source/pricing/pricing.component | 2 +- scaddins/source/pricing/pricing.cxx | 6 ++---- 4 files changed, 6 insertions(+), 10 deletions(-) (limited to 'scaddins') 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 @@ + constructor="scaddins_ScaDateAddIn_get_implementation" single-instance="true"> 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 #include #include +#include #include #include -#include #include #include #include @@ -91,9 +91,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* scaddins_ScaDateAddIn_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new ScaDateAddIn()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(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 @@ + constructor="scaddins_ScaPricingAddIn_get_implementation" single-instance="true"> 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 #include +#include #include #include #include #include -#include #include #include @@ -93,9 +93,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* scaddins_ScaPricingAddIn_get_implementation( css::uno::XComponentContext* , css::uno::Sequence const&) { - static rtl::Reference g_Instance(new ScaPricingAddIn()); - g_Instance->acquire(); - return static_cast(g_Instance.get()); + return cppu::acquire(static_cast(new ScaPricingAddIn())); } // "normal" service implementation -- cgit