[Libreoffice-commits] core.git: dbaccess/source

Marcos Paulo de Souza marcos.souza.org at gmail.com
Mon Dec 9 23:34:06 PST 2013


 dbaccess/source/core/api/RowSet.cxx                      |    5 +++--
 dbaccess/source/core/api/column.cxx                      |    5 +++--
 dbaccess/source/core/api/preparedstatement.cxx           |    3 ++-
 dbaccess/source/core/api/querycomposer.cxx               |    4 ++--
 dbaccess/source/core/api/querydescriptor.cxx             |    3 ++-
 dbaccess/source/core/api/resultset.cxx                   |    4 ++--
 dbaccess/source/core/api/statement.cxx                   |    4 ++--
 dbaccess/source/core/dataaccess/bookmarkcontainer.cxx    |    5 ++---
 dbaccess/source/core/dataaccess/connection.cxx           |    4 ++--
 dbaccess/source/core/dataaccess/connection.hxx           |   10 +++-------
 dbaccess/source/core/dataaccess/dataaccessdescriptor.cxx |   11 +++--------
 dbaccess/source/core/dataaccess/databasecontext.cxx      |    3 ++-
 dbaccess/source/core/dataaccess/databasedocument.cxx     |    3 ++-
 dbaccess/source/core/dataaccess/datasource.cxx           |    4 ++--
 dbaccess/source/filter/xml/dbloader2.cxx                 |    8 +-------
 15 files changed, 33 insertions(+), 43 deletions(-)

New commits:
commit afd32065b619a6016658eaac650a29d0d03d4c61
Author: Marcos Paulo de Souza <marcos.souza.org at gmail.com>
Date:   Thu Dec 5 12:47:58 2013 -0200

    fdo#54938: Convert dbaccess to use cppu::supportsService
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>
    Conflicts:
    	dbaccess/source/core/dataaccess/connection.hxx
    
    Change-Id: Id7602b969790b13538868b937842bc945ce3e31e

diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index f2c4345..07fc875 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 7483afa..9d523b2 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 811d545..9e6b5e2 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 3f7c5d5..ca71328 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 1c2f650..e08e751 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 f11a4ec..d0b5834 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 eb98b17..b6b35e9 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 3778325..3750da8 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 e5fedf1..23d1a08 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 4ae7e7e..1672462 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 594aa92..263fa92 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 f13e381..a25c65d 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 0b7dd0a..38c1ff4 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 c2b46de..b1a994c 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 7855320..c4e6a8b 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


More information about the Libreoffice-commits mailing list