[Libreoffice-commits] core.git: 2 commits - basic/source comphelper/source configmgr/source dbaccess/source oox/source svl/source svtools/source
Stephan Bergmann
sbergman at redhat.com
Thu Oct 17 06:04:17 PDT 2013
basic/source/uno/namecont.cxx | 15 +------
comphelper/source/container/enumerablemap.cxx | 8 +---
comphelper/source/misc/documentiologring.cxx | 13 +-----
comphelper/source/misc/ihwrapnofilter.cxx | 12 +-----
comphelper/source/misc/instancelocker.cxx | 13 +-----
comphelper/source/misc/officerestartmanager.cxx | 12 +-----
comphelper/source/officeinstdir/officeinstallationdirectories.cxx | 14 +------
comphelper/source/property/genericpropertyset.cxx | 11 +----
comphelper/source/property/opropertybag.cxx | 7 +--
comphelper/source/streaming/seqinputstreamserv.cxx | 8 +---
comphelper/source/streaming/seqoutputstreamserv.cxx | 8 +---
configmgr/source/access.cxx | 12 +-----
dbaccess/source/core/misc/DatabaseDataProvider.cxx | 4 +-
dbaccess/source/filter/xml/dbloader2.cxx | 9 +---
dbaccess/source/sdbtools/connection/connectiontools.cxx | 6 +--
dbaccess/source/ui/browser/dbloader.cxx | 9 +---
dbaccess/source/ui/browser/genericcontroller.cxx | 10 +----
oox/source/core/fasttokenhandler.cxx | 16 +-------
oox/source/core/filterdetect.cxx | 6 +--
oox/source/docprop/ooxmldocpropimport.cxx | 19 +---------
svl/source/fsstor/fsfactory.cxx | 9 +---
svtools/source/graphic/descriptor.cxx | 12 +-----
svtools/source/graphic/renderer.cxx | 12 +-----
svtools/source/hatchwindow/documentcloser.cxx | 15 +------
svtools/source/hatchwindow/hatchwindowfactory.cxx | 14 +------
svtools/source/uno/genericunodialog.cxx | 9 +---
svtools/source/uno/popupmenucontrollerbase.cxx | 17 +-------
svtools/source/uno/popupwindowcontroller.cxx | 11 +----
svtools/source/uno/unoimap.cxx | 12 +-----
29 files changed, 60 insertions(+), 263 deletions(-)
New commits:
commit 2d1675c3adbd3f3ff4b0d6815c88938ed775b9b2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Oct 17 15:03:50 2013 +0200
The getSupportedServiceNames implementations will already take care
Change-Id: I0c7ae8e0393f069259b943e04368e874abdf8386
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index fa71d36..5ad7de4 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2971,7 +2971,6 @@ void SAL_CALL SfxLibraryContainer::broadcastVBAScriptEvent( sal_Int32 nIdentifie
sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const OUString& _rServiceName )
throw (RuntimeException)
{
- LibraryContainerMethodGuard aGuard( *this );
return cppu::supportsService(this, _rServiceName);
}
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 7ee8a03..2b047df 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -72,8 +72,8 @@
#include "comphelper/sequenceasvector.hxx"
#include "cppu/unotype.hxx"
#include "cppuhelper/queryinterface.hxx"
+#include "cppuhelper/supportsservice.hxx"
#include "cppuhelper/weak.hxx"
-#include <cppuhelper/supportsservice.hxx>
#include "osl/interlck.h"
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
@@ -222,9 +222,6 @@ OUString Access::getImplementationName() throw (css::uno::RuntimeException)
sal_Bool Access::supportsService(OUString const & ServiceName)
throw (css::uno::RuntimeException)
{
- assert(thisIs(IS_ANY));
- osl::MutexGuard g(*lock_);
- checkLocalizedPropertyAccess();
return cppu::supportsService(this, ServiceName);
}
commit 3d3293144b0e0d2d28136b1b2c7154d6352463b8
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date: Wed Oct 16 19:25:05 2013 -0300
fdo#54938: Adapt svtools and comphelper module ...
to use cppu::supportsService and other pieces.
Change-Id: I16893b3d31a8055acd214ff23d01e63d38fe0826
Signed-off-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 70e88d3..fa71d36 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/deployment/ExtensionManager.hpp>
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <basic/sbmod.hxx>
#include <boost/scoped_ptr.hpp>
@@ -2971,20 +2972,9 @@ sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const OUString& _rServic
throw (RuntimeException)
{
LibraryContainerMethodGuard aGuard( *this );
- Sequence< OUString > aSupportedServices( getSupportedServiceNames() );
- const OUString* pSupportedServices = aSupportedServices.getConstArray();
- for ( sal_Int32 i=0; i<aSupportedServices.getLength(); ++i, ++pSupportedServices )
- {
- if ( *pSupportedServices == _rServiceName )
- {
- return sal_True;
- }
- }
- return sal_False;
+ return cppu::supportsService(this, _rServiceName);
}
-//============================================================================
-
// Implementation class SfxLibrary
// Ctor
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 1896a60..87c8634 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -32,6 +32,7 @@
#include <cppuhelper/compbase3.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
#include <typelib/typedescription.hxx>
@@ -693,14 +694,9 @@ namespace comphelper
return getImplementationName_static();
}
- //--------------------------------------------------------------------
::sal_Bool SAL_CALL EnumerableMap::supportsService( const OUString& _serviceName ) throw (RuntimeException)
{
- Sequence< OUString > aServices( getSupportedServiceNames() );
- for ( sal_Int32 i=0; i<aServices.getLength(); ++i )
- if ( _serviceName == aServices[i] )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, _serviceName);
}
//--------------------------------------------------------------------
diff --git a/comphelper/source/misc/documentiologring.cxx b/comphelper/source/misc/documentiologring.cxx
index 28df327..5b94364 100644
--- a/comphelper/source/misc/documentiologring.cxx
+++ b/comphelper/source/misc/documentiologring.cxx
@@ -22,6 +22,7 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
#include <comphelper_module.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "documentiologring.hxx"
@@ -135,26 +136,16 @@ void SAL_CALL OSimpleLogRing::initialize( const uno::Sequence< uno::Any >& aArgu
}
// XServiceInfo
-// ----------------------------------------------------------
OUString SAL_CALL OSimpleLogRing::getImplementationName() throw (uno::RuntimeException)
{
return getImplementationName_static();
}
-// ----------------------------------------------------------
::sal_Bool SAL_CALL OSimpleLogRing::supportsService( const OUString& aServiceName ) throw (uno::RuntimeException)
{
- const uno::Sequence< OUString > & aSupportedNames = getSupportedServiceNames_static();
- for ( sal_Int32 nInd = 0; nInd < aSupportedNames.getLength(); nInd++ )
- {
- if ( aSupportedNames[ nInd ].equals( aServiceName ) )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, aServiceName);
}
-// ----------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OSimpleLogRing::getSupportedServiceNames() throw (uno::RuntimeException)
{
return getSupportedServiceNames_static();
diff --git a/comphelper/source/misc/ihwrapnofilter.cxx b/comphelper/source/misc/ihwrapnofilter.cxx
index 7999bbd..f16fc51 100644
--- a/comphelper/source/misc/ihwrapnofilter.cxx
+++ b/comphelper/source/misc/ihwrapnofilter.cxx
@@ -19,6 +19,7 @@
#include "comphelper/ihwrapnofilter.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/document/NoSuchFilterRequest.hpp>
//.........................................................................
@@ -98,10 +99,7 @@ namespace comphelper
{
}
- //----------------------------------------------------------------------------------------------------
// XServiceInfo
- //----------------------------------------------------------------------------------------------------
-
OUString SAL_CALL OIHWrapNoFilterDialog::getImplementationName()
throw ( uno::RuntimeException )
{
@@ -111,13 +109,7 @@ namespace comphelper
::sal_Bool SAL_CALL OIHWrapNoFilterDialog::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL OIHWrapNoFilterDialog::getSupportedServiceNames()
diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx
index f14be18..b256908 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -19,6 +19,7 @@
#include "comphelper_module.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/util/XCloseBroadcaster.hpp>
#include <com/sun/star/util/XCloseable.hpp>
@@ -187,29 +188,19 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg
m_bInitialized = sal_True;
}
-
// XServiceInfo
-// --------------------------------------------------------
OUString SAL_CALL OInstanceLocker::getImplementationName( )
throw (uno::RuntimeException)
{
return getImplementationName_static();
}
-// --------------------------------------------------------
::sal_Bool SAL_CALL OInstanceLocker::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- uno::Sequence< OUString > aSeq = getSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-// --------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OInstanceLocker::getSupportedServiceNames()
throw (uno::RuntimeException)
{
diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx
index 8bde58a..e3a0398 100644
--- a/comphelper/source/misc/officerestartmanager.cxx
+++ b/comphelper/source/misc/officerestartmanager.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper_module.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "officerestartmanager.hxx"
using namespace ::com::sun::star;
@@ -168,20 +169,11 @@ OUString SAL_CALL OOfficeRestartManager::getImplementationName() throw (uno::Run
return getImplementationName_static();
}
-// ----------------------------------------------------------
::sal_Bool SAL_CALL OOfficeRestartManager::supportsService( const OUString& aServiceName ) throw (uno::RuntimeException)
{
- const uno::Sequence< OUString > & aSupportedNames = getSupportedServiceNames_static();
- for ( sal_Int32 nInd = 0; nInd < aSupportedNames.getLength(); nInd++ )
- {
- if ( aSupportedNames[ nInd ].equals( aServiceName ) )
- return sal_True;
- }
-
- return sal_False;
+ return cppu::supportsService(this, aServiceName);
}
-// ----------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OOfficeRestartManager::getSupportedServiceNames() throw (uno::RuntimeException)
{
return getSupportedServiceNames_static();
diff --git a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
index 43f38bc..e5962c7 100644
--- a/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
+++ b/comphelper/source/officeinstdir/officeinstallationdirectories.cxx
@@ -20,6 +20,7 @@
#include <config_folders.h>
#include "comphelper_module.hxx"
+#include <cppuhelper/supportsservice.hxx>
/**************************************************************************
TODO
@@ -216,25 +217,14 @@ OfficeInstallationDirectories::getImplementationName()
return getImplementationName_static();
}
-//=========================================================================
// virtual
sal_Bool SAL_CALL
OfficeInstallationDirectories::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- const uno::Sequence< OUString > & aNames
- = getSupportedServiceNames();
- const OUString * p = aNames.getConstArray();
- for ( sal_Int32 nPos = 0; nPos < aNames.getLength(); nPos++ )
- {
- if ( p[ nPos ].equals( ServiceName ) )
- return sal_True;
- }
- return sal_False;
-
+ return cppu::supportsService(this, ServiceName);
}
-//=========================================================================
// virtual
uno::Sequence< OUString > SAL_CALL
OfficeInstallationDirectories::getSupportedServiceNames()
diff --git a/comphelper/source/property/genericpropertyset.cxx b/comphelper/source/property/genericpropertyset.cxx
index 831dc59..fd052bb 100644
--- a/comphelper/source/property/genericpropertyset.cxx
+++ b/comphelper/source/property/genericpropertyset.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <cppuhelper/weakagg.hxx>
#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/propertysethelper.hxx>
#include <osl/mutex.hxx>
#include <comphelper/genericpropertyset.hxx>
@@ -252,17 +253,9 @@ uno::Sequence< sal_Int8 > SAL_CALL GenericPropertySet::getImplementationId()
}
// XServiceInfo
-
sal_Bool SAL_CALL GenericPropertySet::supportsService( const OUString& ServiceName ) throw(RuntimeException)
{
- 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 GenericPropertySet::getImplementationName() throw( RuntimeException )
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index d54fdf3..86cf28c 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/beans/Property.hpp>
#include <comphelper/namedvaluecollection.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <osl/thread.h>
@@ -142,13 +143,9 @@ namespace comphelper
return getImplementationName_static();
}
- //--------------------------------------------------------------------
::sal_Bool SAL_CALL OPropertyBag::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- Sequence< OUString > aServices( getSupportedServiceNames_static() );
- const OUString* pStart = aServices.getConstArray();
- const OUString* pEnd = aServices.getConstArray() + aServices.getLength();
- return ::std::find( pStart, pEnd, rServiceName ) != pEnd;
+ return cppu::supportsService(this, rServiceName);
}
//--------------------------------------------------------------------
diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx
index de10a03..22986e5 100644
--- a/comphelper/source/streaming/seqinputstreamserv.cxx
+++ b/comphelper/source/streaming/seqinputstreamserv.cxx
@@ -26,6 +26,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/seqstream.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/io/XSeekableInputStream.hpp>
@@ -102,12 +103,7 @@ OUString SAL_CALL SequenceInputStreamService::getImplementationName_static()
::sal_Bool SAL_CALL SequenceInputStreamService::supportsService( OUString const & serviceName ) throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > serviceNames = getSupportedServiceNames();
- for ( ::sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) {
- if ( serviceNames[i] == serviceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, serviceName);
}
uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServiceNames() throw ( uno::RuntimeException )
diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx
index 1acb945..c5026f8 100644
--- a/comphelper/source/streaming/seqoutputstreamserv.cxx
+++ b/comphelper/source/streaming/seqoutputstreamserv.cxx
@@ -25,6 +25,7 @@
#include <cppuhelper/factory.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/seqstream.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/io/XSequenceOutputStream.hpp>
@@ -88,12 +89,7 @@ OUString SAL_CALL SequenceOutputStreamService::getImplementationName_static()
::sal_Bool SAL_CALL SequenceOutputStreamService::supportsService( OUString const & serviceName ) throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > serviceNames = getSupportedServiceNames();
- for ( ::sal_Int32 i = 0; i < serviceNames.getLength(); ++i ) {
- if ( serviceNames[i] == serviceName )
- return sal_True;
- }
- return sal_False;
+ return cppu::supportsService(this, serviceName);
}
uno::Sequence< OUString > SAL_CALL SequenceOutputStreamService::getSupportedServiceNames() throw ( uno::RuntimeException )
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index a181d62..7ee8a03 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -73,6 +73,7 @@
#include "cppu/unotype.hxx"
#include "cppuhelper/queryinterface.hxx"
#include "cppuhelper/weak.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include "osl/interlck.h"
#include "osl/mutex.hxx"
#include "rtl/ref.hxx"
@@ -224,13 +225,7 @@ sal_Bool Access::supportsService(OUString const & ServiceName)
assert(thisIs(IS_ANY));
osl::MutexGuard g(*lock_);
checkLocalizedPropertyAccess();
- css::uno::Sequence< OUString > names(getSupportedServiceNames());
- for (sal_Int32 i = 0; i < names.getLength(); ++i) {
- if (names[i] == ServiceName) {
- return true;
- }
- }
- return false;
+ return cppu::supportsService(this, ServiceName);
}
css::uno::Sequence< OUString > Access::getSupportedServiceNames()
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index ec94426..0666f60 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -20,8 +20,10 @@
#include "DatabaseDataProvider.hxx"
#include "dbastrings.hrc"
#include "cppuhelper/implbase1.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/types.hxx>
#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <connectivity/FValue.hxx>
#include <connectivity/dbtools.hxx>
#include <rtl/ustrbuf.hxx>
@@ -119,7 +121,7 @@ OUString SAL_CALL DatabaseDataProvider::getImplementationName( ) throw(uno::Run
sal_Bool SAL_CALL DatabaseDataProvider::supportsService( const OUString& _rServiceName ) throw(uno::RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
uno::Sequence< OUString > DatabaseDataProvider::getSupportedServiceNames_Static( ) throw (uno::RuntimeException)
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 9f4bc18..3b38fff 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -59,6 +59,7 @@
#include <comphelper/storagehelper.hxx>
#include <comphelper/types.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/file.hxx>
#include <sfx2/docfile.hxx>
#include <unotools/moduleoptions.hxx>
@@ -195,13 +196,7 @@ OUString SAL_CALL DBTypeDetection::getImplementationName() throw( )
// XServiceInfo
sal_Bool SAL_CALL DBTypeDetection::supportsService(const OUString& ServiceName) throw( )
{
- Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pBegin = aSNL.getConstArray();
- const OUString * pEnd = pBegin + aSNL.getLength();
- for( ; pBegin != pEnd; ++pBegin)
- if( *pBegin == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
diff --git a/dbaccess/source/sdbtools/connection/connectiontools.cxx b/dbaccess/source/sdbtools/connection/connectiontools.cxx
index cc89afb..cd212ea 100644
--- a/dbaccess/source/sdbtools/connection/connectiontools.cxx
+++ b/dbaccess/source/sdbtools/connection/connectiontools.cxx
@@ -23,6 +23,7 @@
#include "datasourcemetadata.hxx"
#include <comphelper/namedvaluecollection.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <connectivity/dbtools.hxx>
#include <connectivity/statementcomposer.hxx>
@@ -102,10 +103,7 @@ namespace sdbtools
::sal_Bool SAL_CALL ConnectionTools::supportsService(const OUString & _ServiceName) throw (RuntimeException)
{
- Sequence< OUString > aSupported( getSupportedServiceNames() );
- const OUString* begin = aSupported.getConstArray();
- const OUString* end = aSupported.getConstArray() + aSupported.getLength();
- return ::std::find( begin, end, _ServiceName ) != end;
+ return cppu::supportsService(this, _ServiceName);
}
Sequence< OUString > SAL_CALL ConnectionTools::getSupportedServiceNames() throw (RuntimeException)
diff --git a/dbaccess/source/ui/browser/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx
index 7f90c92..3b0b795 100644
--- a/dbaccess/source/ui/browser/dbloader.cxx
+++ b/dbaccess/source/ui/browser/dbloader.cxx
@@ -42,6 +42,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <toolkit/awt/vclxwindow.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/diagnose_ex.h>
@@ -126,13 +127,7 @@ OUString SAL_CALL DBContentLoader::getImplementationName() throw( )
// XServiceInfo
sal_Bool SAL_CALL DBContentLoader::supportsService(const OUString& ServiceName) throw( )
{
- Sequence< OUString > aSNL = getSupportedServiceNames();
- const OUString * pBegin = aSNL.getConstArray();
- const OUString * pEnd = pBegin + aSNL.getLength();
- for( ; pBegin != pEnd; ++pBegin)
- if( *pBegin == ServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
// XServiceInfo
diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index 8a60402..5ea4421 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -33,6 +33,7 @@
#include <framework/titlehelper.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/extract.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/sdb/DatabaseContext.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
@@ -960,14 +961,7 @@ bool OGenericUnoController::isUserDefinedFeature( const OUString& _rFeatureURL )
sal_Bool SAL_CALL OGenericUnoController::supportsService(const OUString& ServiceName) throw(RuntimeException)
{
- Sequence< OUString > aSupported(getSupportedServiceNames());
-
- const OUString* pArray = aSupported.getConstArray();
- const OUString* pArrayEnd = aSupported.getConstArray() + aSupported.getLength();
-
- for ( ;( pArray != pArrayEnd ) && !pArray->equals( ServiceName ); ++pArray )
- ;
- return pArray != pArrayEnd;
+ return cppu::supportsService(this, ServiceName);
}
void OGenericUnoController::startConnectionListening(const Reference< XConnection >& _rxConnection)
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx
index c71f966b..f57739c 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -22,17 +22,13 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include "oox/helper/helper.hxx"
#include "oox/token/tokenmap.hxx"
+#include <cppuhelper/supportsservice.hxx>
namespace oox {
namespace core {
-// ============================================================================
-
using namespace ::com::sun::star::uno;
-
-// ============================================================================
-
OUString SAL_CALL FastTokenHandler_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.core.FastTokenHandler" );
@@ -50,8 +46,6 @@ Reference< XInterface > SAL_CALL FastTokenHandler_createInstance( const Referenc
return static_cast< ::cppu::OWeakObject* >( new FastTokenHandler );
}
-// ============================================================================
-
FastTokenHandler::FastTokenHandler() :
mrTokenMap( StaticTokenMap::get() )
{
@@ -62,7 +56,6 @@ FastTokenHandler::~FastTokenHandler()
}
// XServiceInfo
-
OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeException)
{
return FastTokenHandler_getImplementationName();
@@ -70,11 +63,7 @@ OUString SAL_CALL FastTokenHandler::getImplementationName() throw (RuntimeExcept
sal_Bool SAL_CALL FastTokenHandler::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- Sequence< OUString > aServiceNames = FastTokenHandler_getSupportedServiceNames();
- for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
- if( aServiceNames[ nIndex ] == rServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw (RuntimeException)
@@ -83,7 +72,6 @@ Sequence< OUString > SAL_CALL FastTokenHandler::getSupportedServiceNames() throw
}
// XFastTokenHandler
-
sal_Int32 FastTokenHandler::getToken( const OUString& rIdentifier ) throw( RuntimeException )
{
return mrTokenMap.getTokenFromUnicode( rIdentifier );
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 154cee0..ffa44a39 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/io/XStream.hpp>
#include <comphelper/docpasswordhelper.hxx>
#include <comphelper/mediadescriptor.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include "oox/core/fastparser.hxx"
#include "oox/helper/attributelist.hxx"
@@ -382,10 +383,7 @@ OUString SAL_CALL FilterDetect::getImplementationName() throw( RuntimeException
sal_Bool SAL_CALL FilterDetect::supportsService( const OUString& rServiceName ) throw( RuntimeException )
{
- const Sequence< OUString > aServices = FilterDetect_getSupportedServiceNames();
- const OUString* pArray = aServices.getConstArray();
- const OUString* pArrayEnd = pArray + aServices.getLength();
- return ::std::find( pArray, pArrayEnd, rServiceName ) != pArrayEnd;
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL FilterDetect::getSupportedServiceNames() throw( RuntimeException )
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index f4d3092..2361bd1 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -30,11 +30,11 @@
#include "oox/helper/helper.hxx"
#include "docprophandler.hxx"
+#include <cppuhelper/supportsservice.hxx>
+
namespace oox {
namespace docprop {
-// ============================================================================
-
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::embed;
@@ -43,9 +43,6 @@ using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
-
-// ============================================================================
-
OUString SAL_CALL DocumentPropertiesImport_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.docprop.DocumentPropertiesImporter" );
@@ -63,8 +60,6 @@ Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const
return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) );
}
-// ============================================================================
-
namespace {
Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxStorage, const OUString& rStreamType ) throw (RuntimeException)
@@ -103,15 +98,12 @@ Sequence< InputSource > lclGetRelatedStreams( const Reference< XStorage >& rxSto
} // namespace
-// ============================================================================
-
DocumentPropertiesImport::DocumentPropertiesImport( const Reference< XComponentContext >& rxContext ) :
mxContext( rxContext )
{
}
// XServiceInfo
-
OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (RuntimeException)
{
return DocumentPropertiesImport_getImplementationName();
@@ -119,11 +111,7 @@ OUString SAL_CALL DocumentPropertiesImport::getImplementationName() throw (Runti
sal_Bool SAL_CALL DocumentPropertiesImport::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- Sequence< OUString > aServiceNames = DocumentPropertiesImport_getSupportedServiceNames();
- for( sal_Int32 nIndex = 0, nLength = aServiceNames.getLength(); nIndex < nLength; ++nIndex )
- if( aServiceNames[ nIndex ] == rServiceName )
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames() throw (RuntimeException)
@@ -132,7 +120,6 @@ Sequence< OUString > SAL_CALL DocumentPropertiesImport::getSupportedServiceNames
}
// XOOXMLDocumentPropertiesImporter
-
void SAL_CALL DocumentPropertiesImport::importProperties(
const Reference< XStorage >& rxSource, const Reference< XDocumentProperties >& rxDocumentProperties )
throw (RuntimeException, IllegalArgumentException, SAXException, Exception)
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 2396bf0..c10b445 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/io/XSeekable.hpp>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <ucbhelper/fileidentifierconverter.hxx>
#include <ucbhelper/content.hxx>
@@ -168,13 +169,7 @@ OUString SAL_CALL FSStorageFactory::getImplementationName()
sal_Bool SAL_CALL FSStorageFactory::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
uno::Sequence< OUString > SAL_CALL FSStorageFactory::getSupportedServiceNames()
diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx
index 1f6515a..16f3e50 100644
--- a/svtools/source/graphic/descriptor.cxx
+++ b/svtools/source/graphic/descriptor.cxx
@@ -24,6 +24,7 @@
#include <vcl/graphicfilter.hxx>
#include <svl/itemprop.hxx>
#include <comphelper/servicehelper.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -245,19 +246,10 @@ OUString SAL_CALL GraphicDescriptor::getImplementationName()
return getImplementationName_Static();
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL GraphicDescriptor::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 true;
-
- return false;
+ return cppu::supportsService(this, ServiceName);
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 95097fb..7d687ef 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -25,6 +25,7 @@
#include <vcl/svapp.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/propertysetinfo.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <svl/itemprop.hxx>
#include <svtools/grfmgr.hxx>
#include <comphelper/servicehelper.hxx>
@@ -139,19 +140,10 @@ OUString SAL_CALL GraphicRendererVCL::getImplementationName()
return getImplementationName_Static();
}
-// ------------------------------------------------------------------------------
-
sal_Bool SAL_CALL GraphicRendererVCL::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 true;
-
- return false;
+ return cppu::supportsService(this, ServiceName);
}
// ------------------------------------------------------------------------------
diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx
index e0de3c2..9bd1746 100644
--- a/svtools/source/hatchwindow/documentcloser.cxx
+++ b/svtools/source/hatchwindow/documentcloser.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/frame/DoubleInitializationException.hpp>
#include <com/sun/star/awt/XVclWindowPeer.hpp>
#include <comphelper/processfactory.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
#include <vcl/svapp.hxx>
@@ -220,29 +221,19 @@ void SAL_CALL ODocumentCloser::initialize( const uno::Sequence< uno::Any >& aArg
m_bInitialized = sal_True;
}
-
// XServiceInfo
-// --------------------------------------------------------
OUString SAL_CALL ODocumentCloser::getImplementationName( )
throw (uno::RuntimeException)
{
return impl_staticGetImplementationName();
}
-// --------------------------------------------------------
::sal_Bool SAL_CALL ODocumentCloser::supportsService( const OUString& ServiceName )
throw (uno::RuntimeException)
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-// --------------------------------------------------------
uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
throw (uno::RuntimeException)
{
@@ -250,14 +241,12 @@ uno::Sequence< OUString > SAL_CALL ODocumentCloser::getSupportedServiceNames()
}
// Static methods
-// --------------------------------------------------------
uno::Sequence< OUString > SAL_CALL ODocumentCloser::impl_staticGetSupportedServiceNames()
{
const OUString aServiceName( "com.sun.star.embed.DocumentCloser" );
return uno::Sequence< OUString >( &aServiceName, 1 );
}
-// --------------------------------------------------------
OUString SAL_CALL ODocumentCloser::impl_staticGetImplementationName()
{
return OUString( "com.sun.star.comp.embed.DocumentCloser" );
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 51566f4..b4bb862 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -21,6 +21,7 @@
#include "hatchwindowfactory.hxx"
#include "hatchwindow.hxx"
#include "cppuhelper/factory.hxx"
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
#include "documentcloser.hxx"
@@ -66,35 +67,24 @@ uno::Reference< embed::XHatchWindow > SAL_CALL OHatchWindowFactory::createHatchW
return uno::Reference< embed::XHatchWindow >( static_cast< embed::XHatchWindow* >( pResult ) );
}
-//-------------------------------------------------------------------------
OUString SAL_CALL OHatchWindowFactory::getImplementationName()
throw ( uno::RuntimeException )
{
return impl_staticGetImplementationName();
}
-//-------------------------------------------------------------------------
sal_Bool SAL_CALL OHatchWindowFactory::supportsService( const OUString& ServiceName )
throw ( uno::RuntimeException )
{
- uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames();
-
- for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ )
- if ( ServiceName == aSeq[nInd] )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
-//-------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames()
throw ( uno::RuntimeException )
{
return impl_staticGetSupportedServiceNames();
}
-//-------------------------------------------------------------------------
-
extern "C"
{
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index 22d4d52..2e821bf 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -25,6 +25,7 @@
#include <toolkit/awt/vclxwindow.hxx>
#include <comphelper/extract.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <osl/diagnose.h>
@@ -97,15 +98,9 @@ Sequence<Type> SAL_CALL OGenericUnoDialog::getTypes( ) throw(RuntimeException)
);
}
-//-------------------------------------------------------------------------
sal_Bool SAL_CALL OGenericUnoDialog::supportsService(const OUString& ServiceName) throw(RuntimeException)
{
- Sequence< OUString > aSupported(getSupportedServiceNames());
- const OUString* pArray = aSupported.getConstArray();
- for (sal_Int32 i = 0; i < aSupported.getLength(); ++i, ++pArray)
- if (pArray->equals(ServiceName))
- return sal_True;
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
//-------------------------------------------------------------------------
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx
index 952b304..06953fb 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -31,12 +31,7 @@
#include <rtl/ustrbuf.hxx>
#include <osl/mutex.hxx>
#include <comphelper/processfactory.hxx>
-
-//_________________________________________________________________________________________________________________
-// Defines
-//_________________________________________________________________________________________________________________
-//
-
+#include <cppuhelper/supportsservice.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -97,17 +92,9 @@ void SAL_CALL PopupMenuControllerBase::disposing()
}
// XServiceInfo
-
sal_Bool SAL_CALL PopupMenuControllerBase::supportsService( const OUString& ServiceName ) throw (RuntimeException)
{
- const Sequence< OUString > aSNL( getSupportedServiceNames() );
- const OUString * pArray = aSNL.getConstArray();
-
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return true;
-
- return false;
+ return cppu::supportsService(this, ServiceName);
}
// XEventListener
diff --git a/svtools/source/uno/popupwindowcontroller.cxx b/svtools/source/uno/popupwindowcontroller.cxx
index 8784681..772577a 100644
--- a/svtools/source/uno/popupwindowcontroller.cxx
+++ b/svtools/source/uno/popupwindowcontroller.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
+#include <cppuhelper/supportsservice.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/toolbox.hxx>
@@ -169,14 +169,7 @@ void SAL_CALL PopupWindowController::release() throw ()
// XServiceInfo
sal_Bool SAL_CALL PopupWindowController::supportsService( const OUString& ServiceName ) throw(RuntimeException)
{
- const Sequence< OUString > aSNL( getSupportedServiceNames() );
- const OUString * pArray = aSNL.getConstArray();
-
- for( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
- if( pArray[i] == ServiceName )
- return true;
-
- return false;
+ return cppu::supportsService(this, ServiceName);
}
// XInitialization
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index 7071d86..02e0bf2 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -31,6 +31,7 @@
#include <comphelper/propertysetinfo.hxx>
#include <cppuhelper/weakagg.hxx>
#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <list>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
@@ -383,18 +384,9 @@ uno::Sequence< sal_Int8 > SAL_CALL SvUnoImageMapObject::getImplementationId()
}
// XServiceInfo
-
sal_Bool SAL_CALL SvUnoImageMapObject::supportsService( const OUString& ServiceName ) throw(RuntimeException)
{
- const Sequence< OUString > aSNL( getSupportedServiceNames() );
- const OUString * pArray = aSNL.getConstArray();
-
- const sal_Int32 nCount = aSNL.getLength();
- for( sal_Int32 i = 0; i < nCount; i++ )
- if( pArray[i] == ServiceName )
- return sal_True;
-
- return sal_False;
+ return cppu::supportsService(this, ServiceName);
}
Sequence< OUString > SAL_CALL SvUnoImageMapObject::getSupportedServiceNames()
More information about the Libreoffice-commits
mailing list