summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-12-05 12:47:58 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-12-10 08:33:25 +0100
commitafd32065b619a6016658eaac650a29d0d03d4c61 (patch)
tree509b7f93f7e6d03a0ec7e7d2d74b717903c19c65 /dbaccess
parent708a8d7bda4782d1bacac44041ea69c2581316ca (diff)
fdo#54938: Convert dbaccess to use cppu::supportsService
Signed-off-by: Stephan Bergmann <sbergman@redhat.com> Conflicts: dbaccess/source/core/dataaccess/connection.hxx Change-Id: Id7602b969790b13538868b937842bc945ce3e31e
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx5
-rw-r--r--dbaccess/source/core/api/column.cxx5
-rw-r--r--dbaccess/source/core/api/preparedstatement.cxx3
-rw-r--r--dbaccess/source/core/api/querycomposer.cxx4
-rw-r--r--dbaccess/source/core/api/querydescriptor.cxx3
-rw-r--r--dbaccess/source/core/api/resultset.cxx4
-rw-r--r--dbaccess/source/core/api/statement.cxx4
-rw-r--r--dbaccess/source/core/dataaccess/bookmarkcontainer.cxx5
-rw-r--r--dbaccess/source/core/dataaccess/connection.cxx4
-rw-r--r--dbaccess/source/core/dataaccess/connection.hxx10
-rw-r--r--dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx11
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx3
-rw-r--r--dbaccess/source/core/dataaccess/databasedocument.cxx3
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx4
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx8
15 files changed, 33 insertions, 43 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index f2c43457c0dd..07fc87508658 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -70,6 +70,7 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/interfacecontainer.h>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <unotools/syslocale.hxx>
#include <tools/debug.hxx>
@@ -481,7 +482,7 @@ OUString SAL_CALL ORowSet::getImplementationName( ) throw(RuntimeException)
sal_Bool SAL_CALL ORowSet::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > ORowSet::getSupportedServiceNames_static( ) throw (RuntimeException)
@@ -2840,7 +2841,7 @@ OUString ORowSetClone::getImplementationName( ) throw(RuntimeException)
sal_Bool ORowSetClone::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > ORowSetClone::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx
index 7483afa52d0d..9d523b2b0c40 100644
--- a/dbaccess/source/core/api/column.cxx
+++ b/dbaccess/source/core/api/column.cxx
@@ -39,6 +39,7 @@
#include <connectivity/TTableHelper.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <osl/diagnose.h>
#include <tools/debug.hxx>
@@ -98,7 +99,7 @@ OUString OColumn::getImplementationName( ) throw(RuntimeException)
sal_Bool OColumn::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OColumn::getSupportedServiceNames( ) throw (RuntimeException)
@@ -206,7 +207,7 @@ OUString OColumns::getImplementationName( ) throw(RuntimeException)
sal_Bool OColumns::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OColumns::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx
index 811d5450004a..9e6b5e25524c 100644
--- a/dbaccess/source/core/api/preparedstatement.cxx
+++ b/dbaccess/source/core/api/preparedstatement.cxx
@@ -26,6 +26,7 @@
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <preparedstatement.hxx>
#include <resultcolumn.hxx>
@@ -127,7 +128,7 @@ OUString OPreparedStatement::getImplementationName( ) throw(RuntimeException)
sal_Bool OPreparedStatement::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OPreparedStatement::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx
index 3f7c5d50f0cb..ca71328b95eb 100644
--- a/dbaccess/source/core/api/querycomposer.cxx
+++ b/dbaccess/source/core/api/querycomposer.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/uno/XAggregation.hpp>
#include <comphelper/processfactory.hxx>
#include "dbastrings.hrc"
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <unotools/configmgr.hxx>
#include <comphelper/types.hxx>
@@ -138,8 +139,7 @@ OUString OQueryComposer::getImplementationName( ) throw(RuntimeException)
sal_Bool OQueryComposer::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- SAL_INFO("dbaccess", "OQueryComposer::supportsService" );
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OQueryComposer::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx
index 1c2f6501ec32..e08e751672d9 100644
--- a/dbaccess/source/core/api/querydescriptor.cxx
+++ b/dbaccess/source/core/api/querydescriptor.cxx
@@ -24,6 +24,7 @@
#include "dbastrings.hrc"
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include "definitioncolumn.hxx"
@@ -217,7 +218,7 @@ OUString SAL_CALL OQueryDescriptor_Base::getImplementationName( ) throw(Runtime
sal_Bool SAL_CALL OQueryDescriptor_Base::supportsService( const OUString& _rServiceName ) throw(RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > SAL_CALL OQueryDescriptor_Base::getSupportedServiceNames( ) throw(RuntimeException)
diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx
index f11a4ec8bfde..d0b5834a6510 100644
--- a/dbaccess/source/core/api/resultset.cxx
+++ b/dbaccess/source/core/api/resultset.cxx
@@ -22,6 +22,7 @@
#include "apitools.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/sdbc/ResultSetType.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
@@ -191,8 +192,7 @@ OUString OResultSet::getImplementationName( ) throw(RuntimeException)
sal_Bool OResultSet::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- //SAL_INFO("dbaccess", "OResultSet::supportsService" );
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OResultSet::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx
index eb98b17def2c..b6b35e9d9f5f 100644
--- a/dbaccess/source/core/api/statement.cxx
+++ b/dbaccess/source/core/api/statement.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <comphelper/property.hxx>
#include <comphelper/types.hxx>
@@ -455,8 +456,7 @@ OUString OStatement::getImplementationName( ) throw(RuntimeException)
sal_Bool OStatement::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- SAL_INFO("dbaccess", "OStatement::supportsService" );
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OStatement::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index 3778325f3dd6..3750da83474c 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -30,6 +30,7 @@
#include <comphelper/extract.hxx>
#include <com/sun/star/lang/XComponent.hpp>
#include <comphelper/types.hxx>
+#include <cppuhelper/supportsservice.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -89,9 +90,7 @@ OUString SAL_CALL OBookmarkContainer::getImplementationName( ) throw(RuntimeExc
sal_Bool SAL_CALL OBookmarkContainer::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- MutexGuard aGuard(m_rMutex);
- checkValid(sal_False);
- return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) throw(RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx
index e5fedf166ff7..23d1a089356f 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -49,6 +49,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/uno3.hxx>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
using namespace ::com::sun::star::uno;
@@ -83,8 +84,7 @@ OUString OConnection::getImplementationName( ) throw(RuntimeException)
sal_Bool OConnection::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- SAL_INFO("dbaccess", "OConnection::supportsService" );
- return findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > OConnection::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/dataaccess/connection.hxx
index 4ae7e7e90e9c..1672462f442d 100644
--- a/dbaccess/source/core/dataaccess/connection.hxx
+++ b/dbaccess/source/core/dataaccess/connection.hxx
@@ -42,11 +42,8 @@
#include <com/sun/star/sdb/tools/XConnectionTools.hpp>
#include <com/sun/star/sdb/application/XTableUIProvider.hpp>
-#ifndef INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14
-#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_14
-#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 14
-#include <comphelper/implbase_var.hxx>
-#endif
+#include <cppuhelper/implbase13.hxx>
+#include <comphelper/stl_types.hxx>
#include <connectivity/ConnectionWrapper.hxx>
#include <connectivity/CommonTools.hxx>
#include <connectivity/warningscontainer.hxx>
@@ -54,7 +51,7 @@
namespace dbaccess
{
-typedef ::comphelper::ImplHelper14 < ::com::sun::star::container::XChild
+typedef cppu::ImplHelper13 < ::com::sun::star::container::XChild
, ::com::sun::star::sdbcx::XTablesSupplier
, ::com::sun::star::sdbcx::XViewsSupplier
, ::com::sun::star::sdbc::XConnection
@@ -62,7 +59,6 @@ typedef ::comphelper::ImplHelper14 < ::com::sun::star::container::XChild
, ::com::sun::star::sdb::XQueriesSupplier
, ::com::sun::star::sdb::XSQLQueryComposerFactory
, ::com::sun::star::sdb::XCommandPreparation
- , ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::lang::XMultiServiceFactory
, ::com::sun::star::sdbcx::XUsersSupplier
, ::com::sun::star::sdbcx::XGroupsSupplier
diff --git a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
index 594aa92478be..263fa92371f6 100644
--- a/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
+++ b/dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx
@@ -34,6 +34,7 @@
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/supportsservice.hxx>
namespace dbaccess
{
@@ -182,10 +183,7 @@ namespace dbaccess
::sal_Bool SAL_CALL DataAccessDescriptor::supportsService( const OUString& rServiceName ) throw (RuntimeException)
{
- Sequence< OUString > aServices( getSupportedServiceNames() );
- const OUString* pStart = aServices.getConstArray();
- const OUString* pEnd = aServices.getConstArray() + aServices.getLength();
- return ::std::find( pStart, pEnd, rServiceName ) != pEnd;
+ return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL DataAccessDescriptor::getSupportedServiceNames( ) throw (RuntimeException)
@@ -280,10 +278,7 @@ namespace dbaccess
::sal_Bool SAL_CALL DataAccessDescriptorFactory::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);
}
Sequence< OUString > SAL_CALL DataAccessDescriptorFactory::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index f13e381f90ae..a25c65dcfca5 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -53,6 +53,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <svl/filenotation.hxx>
@@ -225,7 +226,7 @@ OUString ODatabaseContext::getImplementationName( ) throw(RuntimeException)
sal_Bool ODatabaseContext::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Sequence< OUString > ODatabaseContext::getSupportedServiceNames( ) throw (RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx
index 0b7dd0afa964..38c1ff4ab164 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -74,6 +74,7 @@
#include <connectivity/dbtools.hxx>
#include <cppuhelper/exc_hlp.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <framework/titlehelper.hxx>
#include <unotools/saveopt.hxx>
#include <tools/debug.hxx>
@@ -1878,7 +1879,7 @@ Sequence< OUString > ODatabaseDocument::getSupportedServiceNames_static( ) thro
sal_Bool ODatabaseDocument::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
Reference< XDataSource > SAL_CALL ODatabaseDocument::getDataSource() throw (RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index c2b46de3c4a0..b1a994cf73ca 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -56,6 +56,7 @@
#include <comphelper/property.hxx>
#include <comphelper/seqstream.hxx>
#include <comphelper/sequence.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <connectivity/dbexception.hxx>
#include <connectivity/dbtools.hxx>
#include <cppuhelper/typeprovider.hxx>
@@ -613,8 +614,7 @@ Sequence< OUString > ODatabaseSource::getSupportedServiceNames_static( ) throw
sal_Bool ODatabaseSource::supportsService( const OUString& _rServiceName ) throw (RuntimeException)
{
- SAL_INFO("dbaccess", "ODatabaseSource::supportsService" );
- return ::comphelper::findValue(getSupportedServiceNames(), _rServiceName, sal_True).getLength() != 0;
+ return cppu::supportsService(this, _rServiceName);
}
// OComponentHelper
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index 78553205e49b..c4e6a8bf1874 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -284,13 +284,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