diff options
author | Marcos Paulo de Souza <marcos.souza.org@gmail.com> | 2013-10-26 13:11:42 -0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-10-30 18:17:11 +0100 |
commit | 2b01553fa5982ed50fd37f346a150d1aac8dcd6f (patch) | |
tree | 1daf00bf4b69950c5b75e98571d2b839d5b83327 /svx/source/unodraw | |
parent | 9ab844c7fa907e2d1119a316c695198ef888a059 (diff) |
fdo#54938: Convert svx to use cppu::supportsService
Change-Id: I3ab178924cb1c4240511f08625f244dac54e3913
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/UnoNameItemTable.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/XPropertyTable.cxx | 13 | ||||
-rw-r--r-- | svx/source/unodraw/recoveryui.cxx | 33 | ||||
-rw-r--r-- | svx/source/unodraw/unomod.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unomtabl.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unopool.cxx | 11 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 13 |
8 files changed, 18 insertions, 84 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 21dcfd901236..21a55605d270 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -38,6 +38,7 @@ #include <com/sun/star/drawing/GraphicFilterRequest.hpp> #include <com/sun/star/util/URL.hpp> #include <cppuhelper/implbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> #include <vcl/metaact.hxx> #include <vcl/svapp.hxx> @@ -1229,14 +1230,7 @@ OUString SAL_CALL GraphicExporter::getImplementationName( ) sal_Bool SAL_CALL GraphicExporter::supportsService( const OUString& ServiceName ) throw(RuntimeException) { - Sequence< OUString > aSeq( GraphicExporter_getSupportedServiceNames() ); - sal_Int32 nArgs = aSeq.getLength(); - const OUString* pService = aSeq.getConstArray(); - while( nArgs-- ) - if( *pService++ == ServiceName ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } Sequence< OUString > SAL_CALL GraphicExporter::getSupportedServiceNames( ) diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx index c902f341359b..b696c29665cd 100644 --- a/svx/source/unodraw/UnoNameItemTable.cxx +++ b/svx/source/unodraw/UnoNameItemTable.cxx @@ -23,6 +23,7 @@ #include <svl/itemset.hxx> #include <svl/style.hxx> #include <comphelper/stl_types.hxx> +#include <cppuhelper/supportsservice.hxx> #include <svx/svdmodel.hxx> #include "UnoNameItemTable.hxx" @@ -79,14 +80,7 @@ void SvxUnoNameItemTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw( sal_Bool SAL_CALL SvxUnoNameItemTable::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); } void SAL_CALL SvxUnoNameItemTable::ImplInsertByName( const OUString& aName, const uno::Any& aElement ) diff --git a/svx/source/unodraw/XPropertyTable.cxx b/svx/source/unodraw/XPropertyTable.cxx index 7c4ac26097c4..6c74a99386fc 100644 --- a/svx/source/unodraw/XPropertyTable.cxx +++ b/svx/source/unodraw/XPropertyTable.cxx @@ -29,6 +29,7 @@ #include <vcl/svapp.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <svx/xdef.hxx> #include "svx/unoapi.hxx" @@ -96,17 +97,7 @@ XPropertyEntry* SvxUnoXPropertyTable::get( long index ) const sal_Bool SAL_CALL SvxUnoXPropertyTable::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException) { - const uno::Sequence< OUString > aServices( getSupportedServiceNames() ); - const OUString* pServices = aServices.getConstArray(); - const sal_Int32 nCount = aServices.getLength(); - sal_Int32 i; - for( i = 0; i < nCount; i++ ) - { - if( *pServices++ == ServiceName ) - return sal_True; - } - - return sal_False; + return cppu::supportsService(this, ServiceName); } // XNameContainer diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index e1da634b103a..ce51832b621b 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -28,17 +28,13 @@ #include <osl/file.hxx> #include <rtl/bootstrap.hxx> #include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> #include <boost/scoped_ptr.hpp> #include <officecfg/Office/Recovery.hxx> - -#define IMPLEMENTATIONNAME_RECOVERYUI OUString("com.sun.star.comp.svx.RecoveryUI") -#define SERVICENAME_RECOVERYUI OUString("com.sun.star.dialog.RecoveryUI") - - namespace svx { @@ -47,7 +43,6 @@ namespace svxdr = ::svx::DocRecovery; using namespace ::rtl; using namespace ::osl; -//=============================================== RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& xContext) : m_xContext (xContext ) , m_pParentWindow(0 ) @@ -55,42 +50,28 @@ RecoveryUI::RecoveryUI(const css::uno::Reference< css::uno::XComponentContext >& { } -//=============================================== RecoveryUI::~RecoveryUI() { } -//=============================================== OUString SAL_CALL RecoveryUI::getImplementationName() throw(css::uno::RuntimeException) { return RecoveryUI::st_getImplementationName(); } -//=============================================== sal_Bool SAL_CALL RecoveryUI::supportsService(const OUString& sServiceName) throw(css::uno::RuntimeException) { - const css::uno::Sequence< OUString > lServices = RecoveryUI::st_getSupportedServiceNames(); - sal_Int32 c = lServices.getLength(); - sal_Int32 i = 0; - for (i=0; i<c; ++i) - { - const OUString& sSupportedService = lServices[i]; - if (sSupportedService.equals(sServiceName)) - return sal_True; - } - return sal_False; + return cppu::supportsService(this, sServiceName); } -//=============================================== css::uno::Sequence< OUString > SAL_CALL RecoveryUI::getSupportedServiceNames() throw(css::uno::RuntimeException) { return RecoveryUI::st_getSupportedServiceNames(); } -//=============================================== css::uno::Any SAL_CALL RecoveryUI::dispatchWithReturnValue(const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& ) throw(css::uno::RuntimeException) @@ -151,28 +132,24 @@ void SAL_CALL RecoveryUI::removeStatusListener(const css::uno::Reference< css::f OSL_FAIL("RecoveryUI::removeStatusListener()\nNot implemented yet!"); } -//=============================================== OUString RecoveryUI::st_getImplementationName() { - return OUString(IMPLEMENTATIONNAME_RECOVERYUI); + return OUString("com.sun.star.comp.svx.RecoveryUI"); } -//=============================================== css::uno::Sequence< OUString > RecoveryUI::st_getSupportedServiceNames() { - css::uno::Sequence< OUString > lServiceNames(1); lServiceNames.getArray() [0] = SERVICENAME_RECOVERYUI; + css::uno::Sequence< OUString > lServiceNames(1); + lServiceNames.getArray() [0] = OUString("com.sun.star.dialog.RecoveryUI"); return lServiceNames; } -//=============================================== css::uno::Reference< css::uno::XInterface > SAL_CALL RecoveryUI::st_createInstance(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR) { RecoveryUI* pNew = new RecoveryUI(comphelper::getComponentContext(xSMGR)); return css::uno::Reference< css::uno::XInterface >(static_cast< css::lang::XServiceInfo* >(pNew)); } -//=============================================== - static OUString GetCrashConfigDir() { diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index 6ee8b68b93bf..2c7fef5c6500 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -708,7 +708,7 @@ OUString SAL_CALL SvxUnoDrawPagesAccess::getImplementationName( ) throw(uno::Ru sal_Bool SAL_CALL SvxUnoDrawPagesAccess::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException) { - return ServiceName == pSvxUnoDrawPagesAccessService; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL SvxUnoDrawPagesAccess::getSupportedServiceNames( ) throw(uno::RuntimeException) diff --git a/svx/source/unodraw/unomtabl.cxx b/svx/source/unodraw/unomtabl.cxx index 5673056ba446..76c3e1b5a334 100644 --- a/svx/source/unodraw/unomtabl.cxx +++ b/svx/source/unodraw/unomtabl.cxx @@ -26,6 +26,7 @@ #include <svl/style.hxx> #include <cppuhelper/implbase2.hxx> +#include <cppuhelper/supportsservice.hxx> #include <svl/itempool.hxx> #include <svl/itemset.hxx> #include <svl/lstner.hxx> @@ -131,14 +132,7 @@ void SvxUnoMarkerTable::Notify( SfxBroadcaster&, const SfxHint& rHint ) throw() sal_Bool SAL_CALL SvxUnoMarkerTable::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 SvxUnoMarkerTable::getImplementationName() throw( uno::RuntimeException ) diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx index 48dd8b4a36ac..8686e0a55f1e 100644 --- a/svx/source/unodraw/unopool.cxx +++ b/svx/source/unodraw/unopool.cxx @@ -22,6 +22,7 @@ #include <comphelper/propertysetinfo.hxx> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include "svx/unopool.hxx" @@ -393,17 +394,9 @@ uno::Sequence< sal_Int8 > SAL_CALL SvxUnoDrawPool::getImplementationId() } // XServiceInfo - sal_Bool SAL_CALL SvxUnoDrawPool::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 SvxUnoDrawPool::getImplementationName() throw( uno::RuntimeException ) diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index f5f14a43e0f0..e580014b9743 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -18,6 +18,7 @@ */ #include <cppuhelper/typeprovider.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/awt/XBitmap.hpp> #include <com/sun/star/awt/Rectangle.hpp> #include <com/sun/star/drawing/CircleKind.hpp> @@ -3793,21 +3794,11 @@ uno::Sequence< OUString > SAL_CALL SvxShape::_getSupportedServiceNames() return aSeq; } -//---------------------------------------------------------------------- sal_Bool SAL_CALL SvxShape::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - Sequence< OUString > SupportedServices( getSupportedServiceNames() ); - const OUString * pArray = SupportedServices.getConstArray(); - const sal_Int32 nCount = SupportedServices.getLength(); - sal_Int32 i; - for( i = 0; i < nCount; i++ ) - if( *pArray++ == ServiceName ) - return sal_True; - return sal_False; + return cppu::supportsService(this, ServiceName); } -//---------------------------------------------------------------------- - // XGluePointsSupplier uno::Reference< container::XIndexContainer > SAL_CALL SvxShape::getGluePoints() throw(uno::RuntimeException) |