diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2014-01-14 12:27:09 -0200 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-01-16 10:25:53 +0100 |
commit | a2218b0d8b39e5018342b9085a3ec98941631952 (patch) | |
tree | 5aa97c50be7479c6d301fdd5718424debbff5a38 /svx | |
parent | f32f8285966a0455a7c0db71e196e5ea92390329 (diff) |
fdo#54938: Convert svx and svl to cppu::supportsService...
...final season
Change-Id: Ie51ac231def4a8a6e2681b81de7580798c95eed2
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/svxpixelctlaccessiblecontext.cxx | 33 | ||||
-rw-r--r-- | svx/source/inc/unogalthemeprovider.hxx | 7 | ||||
-rw-r--r-- | svx/source/table/cell.cxx | 19 | ||||
-rw-r--r-- | svx/source/unodraw/UnoNamespaceMap.cxx | 5 | ||||
-rw-r--r-- | svx/source/unodraw/unoctabl.cxx | 10 | ||||
-rw-r--r-- | svx/source/unogallery/unogaltheme.cxx | 18 | ||||
-rw-r--r-- | svx/source/unogallery/unogaltheme.hxx | 6 | ||||
-rw-r--r-- | svx/source/unogallery/unogalthemeprovider.cxx | 22 |
8 files changed, 28 insertions, 92 deletions
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx index 926affdf8949..78cb15124489 100644 --- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx +++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/beans/PropertyChangeEvent.hpp> #include <com/sun/star/awt/XWindow.hpp> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/convert.hxx> @@ -362,33 +363,21 @@ OUString SvxPixelCtlAccessible::getImplementationName( ) throw (uno::RuntimeExc { return OUString("SvxPixelCtlAccessible"); } -/*-- 04.02.2002 14:12:05--------------------------------------------------- - - -----------------------------------------------------------------------*/ -const sal_Char sAccessible[] = "Accessible"; -const sal_Char sAccessibleContext[] = "AccessibleContext"; -const sal_Char sAccessibleComponent[] = "AccessibleComponent"; sal_Bool SvxPixelCtlAccessible::supportsService( const OUString& rServiceName ) throw (uno::RuntimeException) { - return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) || - rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) || - rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 );// || -// rServiceName.equalsAsciiL( sAccessibleTable, sizeof(sAccessibleTable)-1 ); + return cppu::supportsService( this, rServiceName ); } -/*-- 04.02.2002 14:12:05--------------------------------------------------- - -----------------------------------------------------------------------*/ uno::Sequence< OUString > SvxPixelCtlAccessible::getSupportedServiceNames( ) throw (uno::RuntimeException) { uno::Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessible ) ); - pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleContext ) ); - pArray[2] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleComponent) ); -// pArray[3] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleTable) ); + pArray[0] = "Accessible"; + pArray[1] = "AccessibleContext"; + pArray[2] = "AccessibleComponent"; return aRet; } @@ -951,7 +940,6 @@ void SAL_CALL SvxPixelCtlAccessibleChild::removeAccessibleEventListener( const u //===== XServiceInfo ======================================================== - OUString SAL_CALL SvxPixelCtlAccessibleChild::getImplementationName( void ) throw( RuntimeException ) { return OUString( RTL_CONSTASCII_USTRINGPARAM( "SvxPixelCtlAccessibleChild" ) ); @@ -959,19 +947,16 @@ OUString SAL_CALL SvxPixelCtlAccessibleChild::getImplementationName( void ) thro sal_Bool SAL_CALL SvxPixelCtlAccessibleChild::supportsService( const OUString& rServiceName ) throw( RuntimeException ) { - return rServiceName.equalsAsciiL( sAccessible , sizeof(sAccessible )-1 ) || - rServiceName.equalsAsciiL( sAccessibleContext , sizeof(sAccessibleContext )-1 ) || - rServiceName.equalsAsciiL( sAccessibleComponent, sizeof(sAccessibleComponent)-1 ); - + return cppu::supportsService( this, rServiceName ); } Sequence< OUString > SAL_CALL SvxPixelCtlAccessibleChild::getSupportedServiceNames( void ) throw( RuntimeException ) { uno::Sequence< OUString > aRet(3); OUString* pArray = aRet.getArray(); - pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessible ) ); - pArray[1] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleContext ) ); - pArray[2] = OUString( RTL_CONSTASCII_USTRINGPARAM(sAccessibleComponent) ); + pArray[0] = "Accessible"; + pArray[1] = "AccessibleContext"; + pArray[2] = "AccessibleComponent"; return aRet; } diff --git a/svx/source/inc/unogalthemeprovider.hxx b/svx/source/inc/unogalthemeprovider.hxx index 84980ab408c7..9d8fa3cea5d4 100644 --- a/svx/source/inc/unogalthemeprovider.hxx +++ b/svx/source/inc/unogalthemeprovider.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SVX_SOURCE_INC_UNOGALTHEMEPROVIDER_HXX #define INCLUDED_SVX_SOURCE_INC_UNOGALTHEMEPROVIDER_HXX -#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase3.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/gallery/XGalleryThemeProvider.hpp> @@ -29,8 +29,9 @@ class Gallery; namespace { -class GalleryThemeProvider : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XInitialization, - ::com::sun::star::gallery::XGalleryThemeProvider > +class GalleryThemeProvider : public ::cppu::WeakImplHelper3< ::com::sun::star::lang::XInitialization, + ::com::sun::star::gallery::XGalleryThemeProvider, + ::com::sun::star::lang::XServiceInfo > { public: diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 8685e7a647b9..09c21e2a67d6 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -26,6 +26,7 @@ #include <comphelper/string.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> #include <svl/style.hxx> #include <svl/itemset.hxx> @@ -867,30 +868,17 @@ Sequence< sal_Int8 > SAL_CALL Cell::getImplementationId( ) throw (RuntimeExcept return pId->getImplementationId(); } -// ----------------------------------------------------------------------------- // XServiceInfo -// ----------------------------------------------------------------------------- - OUString SAL_CALL Cell::getImplementationName( ) throw (RuntimeException) { return OUString( "com.sun.star.comp.svx.table.Cell" ); } -// ----------------------------------------------------------------------------- - sal_Bool SAL_CALL Cell::supportsService( const OUString& ServiceName ) throw (RuntimeException) { - if( ServiceName == "com.sun.star.table.cell" ) - return sal_True; - - if( ServiceName == "com.sun.star.drawing.cell" ) - return sal_True; - - return SvxUnoTextBase::supportsService( ServiceName ); + return cppu::supportsService( this, ServiceName ); } -// ----------------------------------------------------------------------------- - Sequence< OUString > SAL_CALL Cell::getSupportedServiceNames( ) throw (RuntimeException) { Sequence< OUString > aSeq( SvxUnoTextBase::getSupportedServiceNames() ); @@ -901,10 +889,7 @@ Sequence< OUString > SAL_CALL Cell::getSupportedServiceNames( ) throw (RuntimeE return aSeq; } -// ----------------------------------------------------------------------------- // XLayoutConstrains -// ----------------------------------------------------------------------------- - ::com::sun::star::awt::Size SAL_CALL Cell::getMinimumSize( ) throw (RuntimeException) { return ::com::sun::star::awt::Size( getMinimumWidth(), getMinimumHeight() ); diff --git a/svx/source/unodraw/UnoNamespaceMap.cxx b/svx/source/unodraw/UnoNamespaceMap.cxx index b6add6abf219..361596df2686 100644 --- a/svx/source/unodraw/UnoNamespaceMap.cxx +++ b/svx/source/unodraw/UnoNamespaceMap.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <svl/itempool.hxx> @@ -281,10 +282,10 @@ OUString SAL_CALL NamespaceMap::getImplementationName( ) return NamespaceMap_getImplementationName(); } -sal_Bool SAL_CALL NamespaceMap::supportsService( const OUString& ) +sal_Bool SAL_CALL NamespaceMap::supportsService( const OUString& serviceName ) throw(RuntimeException) { - return sal_True; + return cppu::supportsService( this, serviceName ); } Sequence< OUString > SAL_CALL NamespaceMap::getSupportedServiceNames( ) diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index c1afe3db6dcf..019654c5fd91 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -22,6 +22,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <svx/xtable.hxx> using namespace ::com::sun::star; @@ -72,14 +73,7 @@ SvxUnoColorTable::~SvxUnoColorTable() throw() sal_Bool SAL_CALL SvxUnoColorTable::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - uno::Sequence< OUString > aSNL( getSupportedServiceNames() ); - const OUString * pArray = aSNL.getConstArray(); - - for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) - if( pArray[i] == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService( this, ServiceName ); } OUString SAL_CALL SvxUnoColorTable::getImplementationName() throw( uno::RuntimeException ) diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index 692305232dbc..7017871b7519 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -32,6 +32,7 @@ #include <vcl/svapp.hxx> #include <unotools/pathoptions.hxx> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> using namespace ::com::sun::star; @@ -89,39 +90,24 @@ uno::Sequence< OUString > GalleryTheme::getSupportedServiceNames_Static() return aSeq; } -// ------------------------------------------------------------------------------ - OUString SAL_CALL GalleryTheme::getImplementationName() throw( uno::RuntimeException ) { return getImplementationName_Static(); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL GalleryTheme::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 GalleryTheme::getSupportedServiceNames() throw( uno::RuntimeException ) { return getSupportedServiceNames_Static(); } -// ------------------------------------------------------------------------------ - uno::Sequence< uno::Type > SAL_CALL GalleryTheme::getTypes() throw(uno::RuntimeException) { diff --git a/svx/source/unogallery/unogaltheme.hxx b/svx/source/unogallery/unogaltheme.hxx index c2d06898528b..5359d14c0b75 100644 --- a/svx/source/unogallery/unogaltheme.hxx +++ b/svx/source/unogallery/unogaltheme.hxx @@ -22,7 +22,7 @@ #include <list> -#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/implbase2.hxx> #include <svl/lstner.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/gallery/XGalleryTheme.hpp> @@ -38,7 +38,9 @@ namespace unogallery { // - GalleryTheme - // ---------------- -class GalleryTheme : public ::cppu::WeakImplHelper1< ::com::sun::star::gallery::XGalleryTheme >, +class GalleryTheme : public ::cppu::WeakImplHelper2< + ::com::sun::star::gallery::XGalleryTheme, + ::com::sun::star::lang::XServiceInfo >, public SfxListener { friend class ::unogallery::GalleryItem; diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx index 2400573197be..7878e906ecd7 100644 --- a/svx/source/unogallery/unogalthemeprovider.cxx +++ b/svx/source/unogallery/unogalthemeprovider.cxx @@ -25,6 +25,7 @@ #include <vcl/svapp.hxx> #include <unotools/pathoptions.hxx> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/gallery/XGalleryTheme.hpp> #include <com/sun/star/beans/PropertyValue.hpp> @@ -38,37 +39,22 @@ GalleryThemeProvider::GalleryThemeProvider() : mpGallery = ::Gallery::GetGalleryInstance(); } -// ------------------------------------------------------------------------------ - GalleryThemeProvider::~GalleryThemeProvider() { } -// ------------------------------------------------------------------------------ - OUString SAL_CALL GalleryThemeProvider::getImplementationName() throw( uno::RuntimeException ) { return OUString( "com.sun.star.comp.gallery.GalleryThemeProvider" ); } -// ------------------------------------------------------------------------------ - sal_Bool SAL_CALL GalleryThemeProvider::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 GalleryThemeProvider::getSupportedServiceNames() throw( uno::RuntimeException ) { @@ -77,8 +63,6 @@ uno::Sequence< OUString > SAL_CALL GalleryThemeProvider::getSupportedServiceName return aSeq; } -// ------------------------------------------------------------------------------ - uno::Sequence< uno::Type > SAL_CALL GalleryThemeProvider::getTypes() throw(uno::RuntimeException) { @@ -106,8 +90,6 @@ uno::Sequence< sal_Int8 > SAL_CALL GalleryThemeProvider::getImplementationId() return theGalleryThemeProviderImplementationId::get().getSeq(); } -// ------------------------------------------------------------------------------ - void SAL_CALL GalleryThemeProvider::initialize( const uno::Sequence< uno::Any >& rArguments ) throw ( uno::Exception, uno::RuntimeException ) { |