diff options
author | Alexandre Vicenzi <vicenzi.alexandre@gmail.com> | 2014-01-31 03:39:50 -0200 |
---|---|---|
committer | Marcos Souza <marcos.souza.org@gmail.com> | 2014-02-05 14:29:57 +0000 |
commit | e17cf910320848edbc3d11ec62acbf1c8f531ae5 (patch) | |
tree | c5652289152a460c42b7e4f3e54ce006be4e52cd /comphelper | |
parent | a7395942aecd2523ab392b09018dcc1a05527077 (diff) |
fdo#54938 Convert comphelper and vcl to cppu::supportsService
Change-Id: I391a7324bf92208fe632dac17874943343b1f65a
Reviewed-on: https://gerrit.libreoffice.org/7757
Reviewed-by: Marcos Souza <marcos.souza.org@gmail.com>
Tested-by: Marcos Souza <marcos.souza.org@gmail.com>
Diffstat (limited to 'comphelper')
3 files changed, 6 insertions, 21 deletions
diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx index 88842f0b333d..28017292cfa0 100644 --- a/comphelper/source/compare/AnyCompareFactory.cxx +++ b/comphelper/source/compare/AnyCompareFactory.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "comphelper_module.hxx" #include <com/sun/star/ucb/XAnyCompareFactory.hpp> @@ -27,21 +26,18 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase1.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <map> - using namespace com::sun::star::uno; using namespace com::sun::star::ucb; using namespace com::sun::star::lang; using namespace com::sun::star::i18n; - -//============================================================================= - class AnyCompare : public ::cppu::WeakImplHelper1< XAnyCompare > { Reference< XCollator > m_rCollator; @@ -57,8 +53,6 @@ public: virtual sal_Int16 SAL_CALL compare( const Any& any1, const Any& any2 ) throw(RuntimeException); }; -//============================================================================= - class AnyCompareFactory : public cppu::WeakImplHelper3< XAnyCompareFactory, XInitialization, XServiceInfo > { Reference< XAnyCompare > m_rAnyCompare; @@ -87,8 +81,6 @@ public: static Reference< XInterface > SAL_CALL Create( const Reference< XComponentContext >& ); }; -//=========================================================================================== - sal_Int16 SAL_CALL AnyCompare::compare( const Any& any1, const Any& any2 ) throw(::com::sun::star::uno::RuntimeException) { sal_Int16 aResult = 0; @@ -104,8 +96,6 @@ sal_Int16 SAL_CALL AnyCompare::compare( const Any& any1, const Any& any2 ) throw return aResult; } -//=========================================================================================== - Reference< XAnyCompare > SAL_CALL AnyCompareFactory::createAnyCompareByName( const OUString& aPropertyName ) throw(::com::sun::star::uno::RuntimeException) { // for now only OUString properties compare is implemented @@ -127,7 +117,6 @@ void SAL_CALL AnyCompareFactory::initialize( const Sequence< Any >& aArguments ) return; } } - } OUString SAL_CALL AnyCompareFactory::getImplementationName( ) throw( RuntimeException ) @@ -142,8 +131,7 @@ OUString SAL_CALL AnyCompareFactory::getImplementationName_static( ) sal_Bool SAL_CALL AnyCompareFactory::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - OUString aServiceName( "com.sun.star.ucb.AnyCompareFactory" ); - return aServiceName == ServiceName; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL AnyCompareFactory::getSupportedServiceNames( ) throw(RuntimeException) diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx index 38dca1d9ff62..ee4bc6c457bb 100644 --- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx +++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx @@ -17,7 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include "comphelper_module.hxx" #include <com/sun/star/container/XIndexContainer.hpp> @@ -25,6 +24,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/implbase2.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/supportsservice.hxx> #include <vector> @@ -226,8 +226,7 @@ OUString SAL_CALL IndexedPropertyValuesContainer::getImplementationName_static( sal_Bool SAL_CALL IndexedPropertyValuesContainer::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - OUString aServiceName( "com.sun.star.document.IndexedPropertyValues" ); - return aServiceName == ServiceName; + return cppu::supportsService(this, ServiceName); } ::com::sun::star::uno::Sequence< OUString > SAL_CALL IndexedPropertyValuesContainer::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) diff --git a/comphelper/source/container/NamedPropertyValuesContainer.cxx b/comphelper/source/container/NamedPropertyValuesContainer.cxx index 66817f298c2b..9492944467e0 100644 --- a/comphelper/source/container/NamedPropertyValuesContainer.cxx +++ b/comphelper/source/container/NamedPropertyValuesContainer.cxx @@ -25,7 +25,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <cppuhelper/implbase2.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> - +#include <cppuhelper/supportsservice.hxx> #include <map> @@ -197,8 +197,7 @@ OUString SAL_CALL NamedPropertyValuesContainer::getImplementationName_static( ) sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException) { - OUString aServiceName( "com.sun.star.document.NamedPropertyValues" ); - return aServiceName == ServiceName; + return cppu::supportsService(this, ServiceName); } ::com::sun::star::uno::Sequence< OUString > SAL_CALL NamedPropertyValuesContainer::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) @@ -206,7 +205,6 @@ sal_Bool SAL_CALL NamedPropertyValuesContainer::supportsService( const OUString& return getSupportedServiceNames_static(); } - ::com::sun::star::uno::Sequence< OUString > SAL_CALL NamedPropertyValuesContainer::getSupportedServiceNames_static( ) { const OUString aServiceName( "com.sun.star.document.NamedPropertyValues" ); |