summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-24 14:55:08 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-10-25 08:07:04 +0000
commitda5449da0c056a3a0da239eff2e2b8b66cfd6224 (patch)
tree6f6698e676726bd8a07f281a9707e448a711d983 /sd
parent01a13519e2a12e1e9b61bab1437d340e389e44bf (diff)
fdo#54938: More uses of cppu::supportsService
Change-Id: Id6bed78d92eba52283a17ab3ca66e751c225e48d Reviewed-on: https://gerrit.libreoffice.org/6423 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx12
-rw-r--r--sd/source/ui/unoidl/unomodule.cxx12
2 files changed, 4 insertions, 20 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 0044f50a6cd2..10781c5930f7 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/beans/XMultiPropertySet.hpp>
#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/propertysethelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <tools/urlobj.hxx>
@@ -1255,16 +1256,7 @@ OUString SAL_CALL DocumentSettings::getImplementationName( )
sal_Bool SAL_CALL DocumentSettings::supportsService( const OUString& ServiceName )
throw(RuntimeException)
{
- const Sequence< OUString > aSeq( getSupportedServiceNames() );
- sal_Int32 nCount = aSeq.getLength();
- const OUString* pServices = aSeq.getConstArray();
- while( nCount-- )
- {
- if( *pServices++ == ServiceName )
- return sal_True;
- }
-
- return sal_True;
+ return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL DocumentSettings::getSupportedServiceNames( )
diff --git a/sd/source/ui/unoidl/unomodule.cxx b/sd/source/ui/unoidl/unomodule.cxx
index 7abf2d499bc8..23518f444cc3 100644
--- a/sd/source/ui/unoidl/unomodule.cxx
+++ b/sd/source/ui/unoidl/unomodule.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include "sddll.hxx"
#include "sdmod.hxx"
@@ -133,16 +134,7 @@ OUString SAL_CALL SdUnoModule::getImplementationName( ) throw(uno::RuntimeExcep
sal_Bool SAL_CALL SdUnoModule::supportsService( const OUString& sServiceName ) throw(uno::RuntimeException)
{
- uno::Sequence< OUString > seqServiceNames = getSupportedServiceNames();
- const OUString* pArray = seqServiceNames.getConstArray();
- for ( sal_Int32 nCounter=0; nCounter<seqServiceNames.getLength(); nCounter++ )
- {
- if ( pArray[nCounter] == sServiceName )
- {
- return sal_True ;
- }
- }
- return sal_False ;
+ return cppu::supportsService(this, sServiceName);
}
uno::Sequence< OUString > SAL_CALL SdUnoModule::getSupportedServiceNames( ) throw(uno::RuntimeException)