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 | |
parent | 9f8e4bd8501e9bb9e286cffed5f35d0f0075e9b8 (diff) |
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')
24 files changed, 230 insertions, 79 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 }; diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index afa2771310df..bbf910cbf641 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -86,8 +86,19 @@ void SAL_CALL OContentHelper::disposing() m_xParentContainer = nullptr; } -IMPLEMENT_SERVICE_INFO_IMPLNAME(OContentHelper, "com.sun.star.comp.sdb.Content") -IMPLEMENT_SERVICE_INFO_SUPPORTS(OContentHelper) +OUString SAL_CALL OContentHelper::getImplementationName() + { + return "com.sun.star.comp.sdb.Content"; + } +sal_Bool SAL_CALL OContentHelper::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 OContentHelper::getSupportedServiceNames() { return { "com.sun.star.ucb.Content" }; diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 22e521053295..4c75363ef158 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -796,7 +796,9 @@ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ODatabaseSource::createArrayHelper( ) const { - BEGIN_PROPERTY_HELPER(13) + css::uno::Sequence< css::beans::Property> aDescriptor(13); + css::beans::Property* pDesc = aDescriptor.getArray(); + sal_Int32 nPos = 0; DECL_PROP_IMPL(INFO, cppu::UnoType<Sequence< PropertyValue >>::get()) css::beans::PropertyAttribute::BOUND); DECL_PROP_IMPL(ISPASSWORDREQUIRED, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::BOUND); DECL_PROP_IMPL(ISREADONLY, cppu::UnoType<bool>::get()) css::beans::PropertyAttribute::READONLY); @@ -810,7 +812,8 @@ Reference< XPropertySetInfo > ODatabaseSource::getPropertySetInfo() DECL_PROP_IMPL(TABLETYPEFILTER, cppu::UnoType<Sequence< OUString >>::get()) css::beans::PropertyAttribute::BOUND); DECL_PROP_IMPL(URL, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::BOUND); DECL_PROP_IMPL(USER, cppu::UnoType<OUString>::get()) css::beans::PropertyAttribute::BOUND); - 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/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 6a2a470b57ec..f878e7b57ee7 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -123,8 +123,19 @@ css::uno::Sequence< css::uno::Type > ODocumentContainer::getTypes() ODocumentContainer_Base::getTypes( ) ); } -IMPLEMENT_SERVICE_INFO_IMPLNAME(ODocumentContainer, "com.sun.star.comp.dba.ODocumentContainer"); -IMPLEMENT_SERVICE_INFO_SUPPORTS(ODocumentContainer); +OUString SAL_CALL ODocumentContainer::getImplementationName() + { + return "com.sun.star.comp.dba.ODocumentContainer"; + }; +sal_Bool SAL_CALL ODocumentContainer::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::Reference< css::beans::XPropertySetInfo > SAL_CALL ODocumentContainer::getPropertySetInfo() { Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) ); diff --git a/dbaccess/source/inc/apitools.hxx b/dbaccess/source/inc/apitools.hxx index c1481b6c40a3..cbfc477673b8 100644 --- a/dbaccess/source/inc/apitools.hxx +++ b/dbaccess/source/inc/apitools.hxx @@ -55,47 +55,10 @@ public: }; -// helper for implementing the XServiceInfo interface - -// (internal - not to be used outside - usually) -#define IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ - OUString SAL_CALL classname::getImplementationName( ) \ - { \ - return implasciiname; \ - } \ - - -#define IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ - sal_Bool SAL_CALL classname::supportsService( const OUString& _rServiceName ) \ - { \ - const css::uno::Sequence< OUString > aSupported(getSupportedServiceNames()); \ - for (const OUString& s : aSupported) \ - if (s == _rServiceName) \ - return true; \ - \ - return false; \ - } \ - - // helper for implementing the createArrayHelper -#define BEGIN_PROPERTY_SEQUENCE(count) \ - css::uno::Sequence< css::beans::Property> aDescriptor(count); \ - css::beans::Property* pDesc = aDescriptor.getArray(); \ - sal_Int32 nPos = 0; \ - -#define BEGIN_PROPERTY_HELPER(count) \ - BEGIN_PROPERTY_SEQUENCE(count) - #define DECL_PROP_IMPL(varname, cpputype) \ pDesc[nPos++] = css::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, cpputype, -#define END_PROPERTY_SEQUENCE() \ - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); \ - -#define END_PROPERTY_HELPER() \ - END_PROPERTY_SEQUENCE() \ - return new ::cppu::OPropertyArrayHelper(aDescriptor); - #endif // INCLUDED_DBACCESS_SOURCE_INC_APITOOLS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx index dad770975a44..8c48a5ec9d7c 100644 --- a/dbaccess/source/ui/querydesign/limitboxcontroller.cxx +++ b/dbaccess/source/ui/querydesign/limitboxcontroller.cxx @@ -213,7 +213,15 @@ OUString SAL_CALL LimitBoxController::getImplementationName() return "org.libreoffice.comp.dbu.LimitBoxController"; } -IMPLEMENT_SERVICE_INFO_SUPPORTS(LimitBoxController) +sal_Bool SAL_CALL LimitBoxController::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 LimitBoxController::getSupportedServiceNames() { diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index 51adc7d651fc..4930ba994454 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -47,7 +47,15 @@ OUString SAL_CALL OColumnControl::getImplementationName() { return SERVICE_CONTROLDEFAULT; } -IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControl) +sal_Bool SAL_CALL OColumnControl::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 OColumnControl::getSupportedServiceNames() { return { "com.sun.star.awt.UnoControl","com.sun.star.sdb.ColumnDescriptorControl" }; diff --git a/dbaccess/source/ui/uno/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx index 9892e514376a..2ed2e56d6b0d 100644 --- a/dbaccess/source/ui/uno/ColumnModel.cxx +++ b/dbaccess/source/ui/uno/ColumnModel.cxx @@ -131,7 +131,15 @@ OUString SAL_CALL OColumnControlModel::getImplementationName() { return "com.sun.star.comp.dbu.OColumnControlModel"; } -IMPLEMENT_SERVICE_INFO_SUPPORTS(OColumnControlModel) +sal_Bool SAL_CALL OColumnControlModel::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 OColumnControlModel::getSupportedServiceNames() { return { "com.sun.star.awt.UnoControlModel","com.sun.star.sdb.ColumnDescriptorControlModel" }; diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 712dbe6bcc73..4040aea94ca7 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -155,7 +155,15 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; { return "com.sun.star.uno.comp.sdb.RowsetFilterDialog"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetFilterDialog) + sal_Bool SAL_CALL RowsetFilterDialog::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 RowsetFilterDialog::getSupportedServiceNames() { return { "com.sun.star.sdb.FilterDialog" }; @@ -203,7 +211,15 @@ constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; { return "com.sun.star.uno.comp.sdb.RowsetOrderDialog"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(RowsetOrderDialog) + sal_Bool SAL_CALL RowsetOrderDialog::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 RowsetOrderDialog::getSupportedServiceNames() { return { "com.sun.star.sdb.OrderDialog" }; diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index c2e67359b908..db2d5be60964 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -350,7 +350,15 @@ namespace dbaui { return "com.sun.star.comp.dbaccess.DatabaseInteractionHandler"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(SQLExceptionInteractionHandler) + sal_Bool SAL_CALL SQLExceptionInteractionHandler::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 SQLExceptionInteractionHandler::getSupportedServiceNames() { return { "com.sun.star.sdb.DatabaseInteractionHandler" }; @@ -361,7 +369,15 @@ namespace dbaui { return "com.sun.star.comp.dbaccess.LegacyInteractionHandler"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(LegacyInteractionHandler) + sal_Bool SAL_CALL LegacyInteractionHandler::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 LegacyInteractionHandler::getSupportedServiceNames() { return { "com.sun.star.sdb.InteractionHandler" }; diff --git a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx index f98c388d6225..aaae73ee1fbf 100644 --- a/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx +++ b/dbaccess/source/ui/uno/textconnectionsettings_uno.cxx @@ -126,7 +126,15 @@ namespace dbaui { return "com.sun.star.comp.dbaccess.OTextConnectionSettingsDialog"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(OTextConnectionSettingsDialog) + sal_Bool SAL_CALL OTextConnectionSettingsDialog::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 OTextConnectionSettingsDialog::getSupportedServiceNames() { return { "com.sun.star.sdb.TextConnectionSettings" }; diff --git a/dbaccess/source/ui/uno/unoDirectSql.cxx b/dbaccess/source/ui/uno/unoDirectSql.cxx index 14f15dc40e44..bc155f76da35 100644 --- a/dbaccess/source/ui/uno/unoDirectSql.cxx +++ b/dbaccess/source/ui/uno/unoDirectSql.cxx @@ -66,7 +66,15 @@ namespace dbaui { return "com.sun.star.comp.sdb.DirectSQLDialog"; } - IMPLEMENT_SERVICE_INFO_SUPPORTS(ODirectSQLDialog) + sal_Bool SAL_CALL ODirectSQLDialog::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 ODirectSQLDialog::getSupportedServiceNames( ) { return { SERVICE_SDB_DIRECTSQLDIALOG }; |