diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-05-03 15:51:17 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-05-03 19:10:52 +0200 |
commit | 406f8e481b161b7a563148cc5887932e5b45bf64 (patch) | |
tree | 0172db9ea3a1abb8644f57bb7cc3c06ed808df82 | |
parent | d78097a07970029b0f5414896a15a327b17f18e8 (diff) |
sc: More services converted to constructors.
Change-Id: I85c66837b5bde7c8c8b7044ae8956c05f3bdb742
-rw-r--r-- | sc/inc/appluno.hxx | 6 | ||||
-rw-r--r-- | sc/inc/funcuno.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/appluno.cxx | 66 | ||||
-rw-r--r-- | sc/source/ui/unoobj/funcuno.cxx | 23 | ||||
-rw-r--r-- | sc/util/sc.component | 9 |
5 files changed, 16 insertions, 91 deletions
diff --git a/sc/inc/appluno.hxx b/sc/inc/appluno.hxx index 982536a4d8d1..6e4621604d18 100644 --- a/sc/inc/appluno.hxx +++ b/sc/inc/appluno.hxx @@ -236,9 +236,6 @@ public: ScRecentFunctionsObj(); virtual ~ScRecentFunctionsObj(); - static OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); - // XRecentFunctions virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -267,9 +264,6 @@ public: ScFunctionListObj(); virtual ~ScFunctionListObj(); - static OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); - // XFunctionDescriptions virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getById( sal_Int32 nId ) diff --git a/sc/inc/funcuno.hxx b/sc/inc/funcuno.hxx index cfef28885588..abbd31f549d8 100644 --- a/sc/inc/funcuno.hxx +++ b/sc/inc/funcuno.hxx @@ -69,9 +69,6 @@ public: ScFunctionAccess(); virtual ~ScFunctionAccess(); - static OUString getImplementationName_Static(); - static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static(); - virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE; // XFunctionAccess diff --git a/sc/source/ui/unoobj/appluno.cxx b/sc/source/ui/unoobj/appluno.cxx index bb6115b1c0a2..f3b1634ae21b 100644 --- a/sc/source/ui/unoobj/appluno.cxx +++ b/sc/source/ui/unoobj/appluno.cxx @@ -112,30 +112,6 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL sc_component_getFactory( ScSpreadsheetSettings_CreateInstance, ScSpreadsheetSettings::getSupportedServiceNames_Static() )); } - else if ( aImpl == ScRecentFunctionsObj::getImplementationName_Static() ) - { - xFactory.set(cppu::createOneInstanceFactory( - static_cast<lang::XMultiServiceFactory*>(pServiceManager), - ScRecentFunctionsObj::getImplementationName_Static(), - ScRecentFunctionsObj_CreateInstance, - ScRecentFunctionsObj::getSupportedServiceNames_Static() )); - } - else if ( aImpl == ScFunctionListObj::getImplementationName_Static() ) - { - xFactory.set(cppu::createOneInstanceFactory( - static_cast<lang::XMultiServiceFactory*>(pServiceManager), - ScFunctionListObj::getImplementationName_Static(), - ScFunctionListObj_CreateInstance, - ScFunctionListObj::getSupportedServiceNames_Static() )); - } - else if ( aImpl == ScFunctionAccess::getImplementationName_Static() ) - { - xFactory.set(cppu::createOneInstanceFactory( - static_cast<lang::XMultiServiceFactory*>(pServiceManager), - ScFunctionAccess::getImplementationName_Static(), - ScFunctionAccess_CreateInstance, - ScFunctionAccess::getSupportedServiceNames_Static() )); - } else if ( aImpl == ScXMLImport_getImplementationName() ) { xFactory.set(cppu::createSingleFactory( @@ -490,27 +466,12 @@ ScRecentFunctionsObj::~ScRecentFunctionsObj() { } -// stuff for exService_... - -uno::Reference<uno::XInterface> SAL_CALL ScRecentFunctionsObj_CreateInstance( - const uno::Reference<lang::XMultiServiceFactory>& /* rSMgr */ ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +ScRecentFunctionsObj_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &) { SolarMutexGuard aGuard; ScDLL::Init(); - return (cppu::OWeakObject*)new ScRecentFunctionsObj(); -} - -OUString ScRecentFunctionsObj::getImplementationName_Static() -{ - return OUString( "stardiv.StarCalc.ScRecentFunctionsObj" ); -} - -uno::Sequence<OUString> ScRecentFunctionsObj::getSupportedServiceNames_Static() -{ - uno::Sequence<OUString> aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = SCRECENTFUNCTIONSOBJ_SERVICE; - return aRet; + return cppu::acquire(new ScRecentFunctionsObj()); } // XRecentFunctions @@ -566,27 +527,12 @@ ScFunctionListObj::~ScFunctionListObj() { } -// stuff for exService_... - -uno::Reference<uno::XInterface> SAL_CALL ScFunctionListObj_CreateInstance( - const uno::Reference<lang::XMultiServiceFactory>& /* rSMgr */ ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +ScFunctionListObj_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &) { SolarMutexGuard aGuard; ScDLL::Init(); - return (cppu::OWeakObject*)new ScFunctionListObj(); -} - -OUString ScFunctionListObj::getImplementationName_Static() -{ - return OUString( "stardiv.StarCalc.ScFunctionListObj" ); -} - -uno::Sequence<OUString> ScFunctionListObj::getSupportedServiceNames_Static() -{ - uno::Sequence<OUString> aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = SCFUNCTIONLISTOBJ_SERVICE; - return aRet; + return cppu::acquire(new ScFunctionListObj()); } static void lcl_FillSequence( uno::Sequence<beans::PropertyValue>& rSequence, const ScFuncDesc& rDesc ) diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 189ee1cc747c..edd4898a5bc5 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -198,33 +198,18 @@ void ScFunctionAccess::Notify( SfxBroadcaster&, const SfxHint& rHint ) } } -// stuff for exService_... - -uno::Reference<uno::XInterface> SAL_CALL ScFunctionAccess_CreateInstance( - const uno::Reference<lang::XMultiServiceFactory>& ) +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL +ScFunctionAcceess_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const &) { SolarMutexGuard aGuard; ScDLL::Init(); - return (::cppu::OWeakObject*) new ScFunctionAccess; -} - -OUString ScFunctionAccess::getImplementationName_Static() -{ - return OUString( "stardiv.StarCalc.ScFunctionAccess" ); -} - -uno::Sequence<OUString> ScFunctionAccess::getSupportedServiceNames_Static() -{ - uno::Sequence<OUString> aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = SCFUNCTIONACCESS_SERVICE; - return aRet; + return cppu::acquire(new ScFunctionAccess); } // XServiceInfo OUString SAL_CALL ScFunctionAccess::getImplementationName() throw(uno::RuntimeException, std::exception) { - return getImplementationName_Static(); + return OUString("stardiv.StarCalc.ScFunctionAccess"); } sal_Bool SAL_CALL ScFunctionAccess::supportsService( const OUString& rServiceName ) diff --git a/sc/util/sc.component b/sc/util/sc.component index b7b65b1c5f07..da55b90a565d 100644 --- a/sc/util/sc.component +++ b/sc/util/sc.component @@ -85,13 +85,16 @@ constructor="ScAutoFormatsObj_get_implementation"> <service name="com.sun.star.sheet.TableAutoFormats"/> </implementation> - <implementation name="stardiv.StarCalc.ScFunctionAccess"> + <implementation name="stardiv.StarCalc.ScFunctionAccess" + constructor="ScFunctionAcceess_get_implementation"> <service name="com.sun.star.sheet.FunctionAccess"/> </implementation> - <implementation name="stardiv.StarCalc.ScFunctionListObj"> + <implementation name="stardiv.StarCalc.ScFunctionListObj" + constructor="ScFunctionListObj_get_implementation"> <service name="com.sun.star.sheet.FunctionDescriptions"/> </implementation> - <implementation name="stardiv.StarCalc.ScRecentFunctionsObj"> + <implementation name="stardiv.StarCalc.ScRecentFunctionsObj" + constructor="ScRecentFunctionsObj_get_implementation"> <service name="com.sun.star.sheet.RecentFunctions"/> </implementation> <implementation name="stardiv.StarCalc.ScSpreadsheetSettings"> |