diff options
-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 |