diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-11-11 09:28:52 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-11-11 11:41:24 +0100 |
commit | 8770656bfe32d3e89acb6d6da5bda261f2051193 (patch) | |
tree | 71074df56844e224a382952457c70b032d6b373a /dbaccess/source/core/api | |
parent | tdf#143128: sw: Add UItest (diff) | |
download | core-8770656bfe32d3e89acb6d6da5bda261f2051193.tar.gz core-8770656bfe32d3e89acb6d6da5bda261f2051193.zip |
Replace some macros in dbaccess part 5
Remove BEGIN_PROPERTY_SEQUENCE + BEGIN_PROPERTY_HELPER
+ BEGIN_PROPERTY_SEQUENCE + BEGIN_PROPERTY_HELPER
+ END_PROPERTY_HELPER + IMPLEMENT_SERVICE_INFO_IMPLNAME
+ IMPLEMENT_SERVICE_INFO_SUPPORTS
Change-Id: I44499ba68a162b01a9dd5192228b8190b1f40c98
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125028
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'dbaccess/source/core/api')
-rw-r--r-- | dbaccess/source/core/api/CRowSetColumn.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/CRowSetDataColumn.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/TableDeco.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/definitioncolumn.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/api/query.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/querycontainer.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/resultcolumn.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/core/api/resultset.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/core/api/statement.cxx | 7 | ||||
-rw-r--r-- | dbaccess/source/core/api/table.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/tablecontainer.cxx | 15 | ||||
-rw-r--r-- | dbaccess/source/core/api/viewcontainer.cxx | 15 |
13 files changed, 118 insertions, 27 deletions
diff --git a/dbaccess/source/core/api/CRowSetColumn.cxx b/dbaccess/source/core/api/CRowSetColumn.cxx index d8e2d18c0ff6..a8b375168968 100644 --- a/dbaccess/source/core/api/CRowSetColumn.cxx +++ b/dbaccess/source/core/api/CRowSetColumn.cxx @@ -42,7 +42,9 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const { - BEGIN_PROPERTY_SEQUENCE(21) + css::uno::Sequence< css::beans::Property> aDescriptor(21); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(CATALOGNAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY ); DECL_PROP_IMPL(DISPLAYSIZE, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY ); @@ -66,7 +68,7 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData DECL_PROP_IMPL(TYPENAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY ); DECL_PROP_IMPL(VALUE, cppu::UnoType<Any>::get()) css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::BOUND); - END_PROPERTY_SEQUENCE() + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx index f66f67cd6d55..f1b7e782e7be 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.cxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx @@ -63,8 +63,9 @@ ORowSetDataColumn::~ORowSetDataColumn() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSetDataColumn::createArrayHelper( ) const { - BEGIN_PROPERTY_SEQUENCE(21) - + css::uno::Sequence< css::beans::Property> aDescriptor(21); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(CATALOGNAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY ); DECL_PROP_IMPL(DISPLAYSIZE, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY ); DECL_PROP_IMPL(ISAUTOINCREMENT, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::READONLY ); @@ -87,7 +88,7 @@ ORowSetDataColumn::~ORowSetDataColumn() DECL_PROP_IMPL(TYPENAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY ); DECL_PROP_IMPL(VALUE, cppu::UnoType<Any>::get()) css::beans::PropertyAttribute::BOUND ); - END_PROPERTY_SEQUENCE() + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 04f233f893b4..401d2dcf4fb9 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -278,8 +278,19 @@ void SAL_CALL OSingleSelectQueryComposer::disposing() } IMPLEMENT_FORWARD_XINTERFACE3(OSingleSelectQueryComposer,OSubComponent,OSingleSelectQueryComposer_BASE,OPropertyContainer) -IMPLEMENT_SERVICE_INFO_IMPLNAME(OSingleSelectQueryComposer, "org.openoffice.comp.dba.OSingleSelectQueryComposer") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OSingleSelectQueryComposer) +OUString SAL_CALL OSingleSelectQueryComposer::getImplementationName() + { + return "org.openoffice.comp.dba.OSingleSelectQueryComposer"; + } +sal_Bool SAL_CALL OSingleSelectQueryComposer::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL OSingleSelectQueryComposer::getSupportedServiceNames() { return { SERVICE_NAME_SINGLESELECTQUERYCOMPOSER }; diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index df93f0ad4cc0..03b8a9495cb9 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -350,8 +350,19 @@ void ODBTableDecorator::construct() } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(ODBTableDecorator, "com.sun.star.sdb.dbaccess.ODBTableDecorator") -IMPLEMENT_SERVICE_INFO_SUPPORTS(ODBTableDecorator) +OUString SAL_CALL ODBTableDecorator::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.ODBTableDecorator"; + } +sal_Bool SAL_CALL ODBTableDecorator::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL ODBTableDecorator::getSupportedServiceNames() { return { SERVICE_SDBCX_TABLE }; diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index bac39fdc4d21..73a11373324c 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -444,7 +444,9 @@ Sequence< OUString > OTableColumnDescriptorWrapper::getSupportedServiceNames( ) // Which optional properties are contained? const sal_Int32 nHaveOptionally (std::bitset<7>(nId).count()); - BEGIN_PROPERTY_SEQUENCE( nHaveAlways + nHaveOptionally ) + css::uno::Sequence< css::beans::Property> aDescriptor(nHaveAlways + nHaveOptionally); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(ISAUTOINCREMENT, cppu::UnoType<bool>::get()) 0); DECL_PROP_IMPL(ISCURRENCY, cppu::UnoType<bool>::get()) 0); @@ -483,7 +485,7 @@ Sequence< OUString > OTableColumnDescriptorWrapper::getSupportedServiceNames( ) DECL_PROP_IMPL(TABLENAME, cppu::UnoType<OUString >::get()) 0); } - END_PROPERTY_SEQUENCE() + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); if ( !m_bIsDescriptor ) { diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index ebaba24a2a9d..f043db068d5e 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -212,8 +212,19 @@ void OQuery::rebuildColumns() } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(OQuery, "com.sun.star.sdb.dbaccess.OQuery") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OQuery) +OUString SAL_CALL OQuery::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.OQuery"; + } +sal_Bool SAL_CALL OQuery::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL OQuery::getSupportedServiceNames( ) { return { SERVICE_SDB_DATASETTINGS, SERVICE_SDB_QUERY, "com.sun.star.sdb.QueryDefinition" }; diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 96c01cf120c8..6e3f05ea4d18 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -131,8 +131,19 @@ void OQueryContainer::disposing() } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(OQueryContainer, "com.sun.star.sdb.dbaccess.OQueryContainer") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OQueryContainer) +OUString SAL_CALL OQueryContainer::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.OQueryContainer"; + } +sal_Bool SAL_CALL OQueryContainer::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL OQueryContainer::getSupportedServiceNames() { return { SERVICE_SDBCX_CONTAINER, SERVICE_SDB_QUERIES }; diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx index 3109861f3db9..ceb233137d16 100644 --- a/dbaccess/source/core/api/resultcolumn.cxx +++ b/dbaccess/source/core/api/resultcolumn.cxx @@ -124,7 +124,9 @@ void OResultColumn::disposing() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OResultColumn::createArrayHelper( ) const { - BEGIN_PROPERTY_HELPER(21) + css::uno::Sequence< css::beans::Property> aDescriptor(21); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(CATALOGNAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(DISPLAYSIZE, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(ISAUTOINCREMENT, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::READONLY); @@ -146,7 +148,8 @@ void OResultColumn::disposing() DECL_PROP_IMPL(TABLENAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(TYPE, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(TYPENAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY); - END_PROPERTY_HELPER(); + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); + return new ::cppu::OPropertyArrayHelper(aDescriptor); } // cppu::OPropertySetHelper diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index 9683b1c6de4b..478d476269d7 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -185,14 +185,17 @@ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const { - BEGIN_PROPERTY_HELPER(6) + css::uno::Sequence< css::beans::Property> aDescriptor(6); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(CURSORNAME, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(FETCHDIRECTION, cppu::UnoType<sal_Int32>::get()) 0); DECL_PROP_IMPL(FETCHSIZE, cppu::UnoType<sal_Int32>::get()) 0); DECL_PROP_IMPL(ISBOOKMARKABLE, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY); DECL_PROP_IMPL(RESULTSETTYPE, cppu::UnoType<sal_Int32>::get()) css::beans::PropertyAttribute::READONLY); - END_PROPERTY_HELPER(); + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); + return new ::cppu::OPropertyArrayHelper(aDescriptor); } // cppu::OPropertySetHelper diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index 3eec82b9e1db..4b8032c9bbae 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -176,7 +176,9 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OStatementBase::createArrayHelper( ) const { - BEGIN_PROPERTY_HELPER(10) + css::uno::Sequence< css::beans::Property> aDescriptor(10); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(CURSORNAME, cppu::UnoType<OUString>::get()) 0); DECL_PROP_IMPL(ESCAPE_PROCESSING, cppu::UnoType<bool>::get()) 0); DECL_PROP_IMPL(FETCHDIRECTION, cppu::UnoType<sal_Int32>::get()) 0); @@ -187,7 +189,8 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() DECL_PROP_IMPL(RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get()) 0); DECL_PROP_IMPL(RESULTSETTYPE, cppu::UnoType<sal_Int32>::get()) 0); DECL_PROP_IMPL(USEBOOKMARKS, cppu::UnoType<bool>::get()) 0); - END_PROPERTY_HELPER(); + OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); + return new ::cppu::OPropertyArrayHelper(aDescriptor); } // cppu::OPropertySetHelper diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx index d355be499a75..52d6b5cf64f6 100644 --- a/dbaccess/source/core/api/table.cxx +++ b/dbaccess/source/core/api/table.cxx @@ -233,8 +233,19 @@ void ODBTable::construct() } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(ODBTable, "com.sun.star.sdb.dbaccess.ODBTable") -IMPLEMENT_SERVICE_INFO_SUPPORTS(ODBTable) +OUString SAL_CALL ODBTable::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.ODBTable"; + } +sal_Bool SAL_CALL ODBTable::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL ODBTable::getSupportedServiceNames() { return { SERVICE_SDBCX_TABLE }; diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index f052128fb926..7aefea3e2306 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -123,8 +123,19 @@ OUString OTableContainer::getTableTypeRestriction() const } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(OTableContainer, "com.sun.star.sdb.dbaccess.OTableContainer") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OTableContainer) +OUString SAL_CALL OTableContainer::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.OTableContainer"; + } +sal_Bool SAL_CALL OTableContainer::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL OTableContainer::getSupportedServiceNames() { return { SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES }; diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 79dd2bc3a795..4e35515a4196 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -61,8 +61,19 @@ OViewContainer::~OViewContainer() } // XServiceInfo -IMPLEMENT_SERVICE_INFO_IMPLNAME(OViewContainer, "com.sun.star.sdb.dbaccess.OViewContainer") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OViewContainer) +OUString SAL_CALL OViewContainer::getImplementationName() + { + return "com.sun.star.sdb.dbaccess.OViewContainer"; + } +sal_Bool SAL_CALL OViewContainer::supportsService(const OUString& _rServiceName) + { + const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); + for (const OUString& s : aSupported) + if (s == _rServiceName) + return true; + + return false; + } css::uno::Sequence< OUString > SAL_CALL OViewContainer::getSupportedServiceNames() { return { SERVICE_SDBCX_CONTAINER, SERVICE_SDBCX_TABLES }; |