diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2014-01-14 12:03:59 -0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-16 10:24:56 +0100 |
commit | cf51afb0269e9c1fd5d51ca8b67b86a38d1da75f (patch) | |
tree | 00ef4329c903d3a00ab8bcd46536edfb8443bf45 /svtools | |
parent | 881c3dfaef958476c353b44ed5e9fbf123a94512 (diff) |
fdo#54938: Convert svtools to cppu::supportsService...
...final part
Conflicts:
svtools/source/filter/SvFilterOptionsDialog.cxx
Change-Id: Ie4a0a7ea8ec65b3e632d06627bba40a26c9a7a91
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/accessibleruler.cxx | 20 | ||||
-rw-r--r-- | svtools/source/control/vclxaccessibleheaderbaritem.cxx | 19 | ||||
-rw-r--r-- | svtools/source/graphic/graphic.cxx | 23 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 20 | ||||
-rw-r--r-- | svtools/source/inc/provider.hxx | 5 | ||||
-rw-r--r-- | svtools/source/uno/unoevent.cxx | 4 |
6 files changed, 13 insertions, 78 deletions
diff --git a/svtools/source/control/accessibleruler.cxx b/svtools/source/control/accessibleruler.cxx index 19e41f7f13d9..02e4f5329613 100644 --- a/svtools/source/control/accessibleruler.cxx +++ b/svtools/source/control/accessibleruler.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/beans/PropertyChangeEvent.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <comphelper/accessibleeventnotifier.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/convert.hxx> @@ -362,7 +363,6 @@ sal_Int32 SvtRulerAccessible::getBackground( ) } //===== XServiceInfo ======================================================== - OUString SAL_CALL SvtRulerAccessible::getImplementationName( void ) throw( RuntimeException ) { return OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.ui.SvtRulerAccessible" ) ); @@ -370,20 +370,7 @@ OUString SAL_CALL SvtRulerAccessible::getImplementationName( void ) throw( Runti sal_Bool SAL_CALL SvtRulerAccessible::supportsService( const OUString& sServiceName ) throw( RuntimeException ) { - ::osl::MutexGuard aGuard( m_aMutex ); - // Iterate over all supported service names and return true if on of them - // matches the given name. - Sequence< OUString > aSupportedServices( getSupportedServiceNames() ); - int nLength = aSupportedServices.getLength(); - const OUString* pStr = aSupportedServices.getConstArray(); - - for( int i = nLength ; i ; --i, ++pStr ) - { - if( sServiceName == *pStr ) - return sal_True; - } - - return sal_False; + return cppu::supportsService( this, sServiceName ); } Sequence< OUString > SAL_CALL SvtRulerAccessible::getSupportedServiceNames( void ) throw( RuntimeException ) @@ -393,15 +380,12 @@ Sequence< OUString > SAL_CALL SvtRulerAccessible::getSupportedServiceNames( void } //===== XTypeProvider ======================================================= - Sequence< sal_Int8 > SAL_CALL SvtRulerAccessible::getImplementationId( void ) throw( RuntimeException ) { return getUniqueId(); } - //===== internals ======================================================== - void SvtRulerAccessible::setName( const OUString& rName ) { msName = rName; diff --git a/svtools/source/control/vclxaccessibleheaderbaritem.cxx b/svtools/source/control/vclxaccessibleheaderbaritem.cxx index d3312655ef6e..d5cbb0263c56 100644 --- a/svtools/source/control/vclxaccessibleheaderbaritem.cxx +++ b/svtools/source/control/vclxaccessibleheaderbaritem.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/accessibility/AccessibleEventId.hpp> #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <cppuhelper/supportsservice.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> @@ -143,30 +144,17 @@ void VCLXAccessibleHeaderBarItem::disposing() AccessibleExtendedComponentHelper_BASE::disposing(); } -// ----------------------------------------------------------------------------- // XServiceInfo -// ----------------------------------------------------------------------------- - OUString VCLXAccessibleHeaderBarItem::getImplementationName() throw (RuntimeException) { return OUString("com.sun.star.comp.svtools.AccessibleHeaderBarItem"); } -// ----------------------------------------------------------------------------- - sal_Bool VCLXAccessibleHeaderBarItem::supportsService( const OUString& rServiceName ) throw (RuntimeException) { - Sequence< OUString > aNames( getSupportedServiceNames() ); - const OUString* pNames = aNames.getConstArray(); - const OUString* pEnd = pNames + aNames.getLength(); - for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) - ; - - return pNames != pEnd; + return cppu::supportsService( this, rServiceName ); } -// ----------------------------------------------------------------------------- - Sequence< OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames() throw (RuntimeException) { Sequence< OUString > aNames(1); @@ -174,10 +162,7 @@ Sequence< OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames() thr return aNames; } -// ----------------------------------------------------------------------------- // XAccessible -// ----------------------------------------------------------------------------- - Reference< XAccessibleContext > VCLXAccessibleHeaderBarItem::getAccessibleContext() throw (RuntimeException) { OExternalLockGuard aGuard( this ); diff --git a/svtools/source/graphic/graphic.cxx b/svtools/source/graphic/graphic.cxx index f81a019cd928..6cfabaa6d545 100644 --- a/svtools/source/graphic/graphic.cxx +++ b/svtools/source/graphic/graphic.cxx @@ -25,6 +25,7 @@ #include <vcl/graph.hxx> #include "graphic.hxx" #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include <string.h> using namespace com::sun::star; @@ -131,36 +132,18 @@ uno::Sequence< OUString > Graphic::getSupportedServiceNames_Static() return aSeq; } -// ------------------------------------------------------------------------------ - OUString SAL_CALL Graphic::getImplementationName() throw( uno::RuntimeException ) { return getImplementationName_Static(); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL Graphic::supportsService( const OUString& rServiceName ) throw( uno::RuntimeException ) { - if( ::unographic::GraphicDescriptor::supportsService( rServiceName ) ) - return true; - else - { - uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString* pArray = aSNL.getConstArray(); - - for( int i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == rServiceName ) - return true; - - return false; - } + return cppu::supportsService( this, rServiceName ); } -// ------------------------------------------------------------------------------ - uno::Sequence< OUString > SAL_CALL Graphic::getSupportedServiceNames() throw( uno::RuntimeException ) { @@ -176,8 +159,6 @@ uno::Sequence< OUString > SAL_CALL Graphic::getSupportedServiceNames() return aRet; } -// ------------------------------------------------------------------------------ - uno::Sequence< uno::Type > SAL_CALL Graphic::getTypes() throw(uno::RuntimeException) { diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 95dda1aab46e..09a8b999ddff 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/io/XStream.hpp> #include <com/sun/star/text/GraphicCrop.hpp> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include "descriptor.hxx" #include "graphic.hxx" @@ -51,37 +52,22 @@ GraphicProvider::GraphicProvider() { } -// ------------------------------------------------------------------------------ - GraphicProvider::~GraphicProvider() { } -// ------------------------------------------------------------------------------ - OUString SAL_CALL GraphicProvider::getImplementationName() throw( uno::RuntimeException ) { return OUString( "com.sun.star.comp.graphic.GraphicProvider" ); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL GraphicProvider::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString* pArray = aSNL.getConstArray(); - - for( int i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return true; - - return false; + return cppu::supportsService( this, ServiceName ); } -// ------------------------------------------------------------------------------ - uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames() throw( uno::RuntimeException ) { @@ -90,8 +76,6 @@ uno::Sequence< OUString > SAL_CALL GraphicProvider::getSupportedServiceNames() return aSeq; } -// ------------------------------------------------------------------------------ - uno::Sequence< uno::Type > SAL_CALL GraphicProvider::getTypes() throw(uno::RuntimeException) { diff --git a/svtools/source/inc/provider.hxx b/svtools/source/inc/provider.hxx index 9b200508e90d..68264d118c7a 100644 --- a/svtools/source/inc/provider.hxx +++ b/svtools/source/inc/provider.hxx @@ -20,14 +20,15 @@ #ifndef INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX #define INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX -#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/awt/XBitmap.hpp> namespace { -class GraphicProvider : public ::cppu::WeakImplHelper1< ::com::sun::star::graphic::XGraphicProvider > +class GraphicProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::graphic::XGraphicProvider, + ::com::sun::star::lang::XServiceInfo > { public: diff --git a/svtools/source/uno/unoevent.cxx b/svtools/source/uno/unoevent.cxx index 9f02391f117b..c75a2bf9f3f9 100644 --- a/svtools/source/uno/unoevent.cxx +++ b/svtools/source/uno/unoevent.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - #include <com/sun/star/beans/PropertyValue.hpp> +#include <cppuhelper/supportsservice.hxx> #include <rtl/ustrbuf.hxx> #include <tools/rtti.hxx> #include <tools/solar.h> @@ -151,7 +151,7 @@ sal_Bool SvBaseEventDescriptor::hasElements() sal_Bool SvBaseEventDescriptor::supportsService(const OUString& rServiceName) throw(RuntimeException) { - return sServiceName.equals(rServiceName); + return cppu::supportsService(this, rServiceName); } Sequence<OUString> SvBaseEventDescriptor::getSupportedServiceNames(void) |