diff options
Diffstat (limited to 'dbaccess/source/core/api')
44 files changed, 397 insertions, 540 deletions
diff --git a/dbaccess/source/core/api/BookmarkSet.cxx b/dbaccess/source/core/api/BookmarkSet.cxx index 75dfc24f5869..75b369885e3b 100644 --- a/dbaccess/source/core/api/BookmarkSet.cxx +++ b/dbaccess/source/core/api/BookmarkSet.cxx @@ -27,12 +27,8 @@ using namespace dbaccess; using namespace ::connectivity; using namespace ::dbtools; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; -using namespace ::osl; void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet,const OUString& i_sRowSetFilter) { diff --git a/dbaccess/source/core/api/CIndexes.cxx b/dbaccess/source/core/api/CIndexes.cxx index 409d877288b8..9b3dd5aefa83 100644 --- a/dbaccess/source/core/api/CIndexes.cxx +++ b/dbaccess/source/core/api/CIndexes.cxx @@ -25,11 +25,8 @@ using namespace connectivity::sdbcx; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; using namespace dbaccess; -using namespace cppu; ObjectType OIndexes::createObject(const OUString& _rName) diff --git a/dbaccess/source/core/api/CIndexes.hxx b/dbaccess/source/core/api/CIndexes.hxx index f20da6cbefa9..d8dbeb82a8f6 100644 --- a/dbaccess/source/core/api/CIndexes.hxx +++ b/dbaccess/source/core/api/CIndexes.hxx @@ -20,6 +20,7 @@ #pragma once #include <connectivity/TIndexes.hxx> +#include <utility> namespace dbaccess { @@ -35,9 +36,9 @@ namespace dbaccess OIndexes(connectivity::OTableHelper* _pTable, ::osl::Mutex& _rMutex, const std::vector< OUString> &_rVector, - const css::uno::Reference< css::container::XNameAccess >& _rxIndexes + css::uno::Reference< css::container::XNameAccess > _rxIndexes ) : connectivity::OIndexesHelper(_pTable,_rMutex,_rVector) - ,m_xIndexes(_rxIndexes) + ,m_xIndexes(std::move(_rxIndexes)) {} virtual void disposing() override; diff --git a/dbaccess/source/core/api/CRowSetColumn.cxx b/dbaccess/source/core/api/CRowSetColumn.cxx index 56328bd18009..98435b7c4498 100644 --- a/dbaccess/source/core/api/CRowSetColumn.cxx +++ b/dbaccess/source/core/api/CRowSetColumn.cxx @@ -44,33 +44,30 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaData ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const { - css::uno::Sequence< css::beans::Property> aDescriptor(21); - css::beans::Property* pDesc = aDescriptor.getArray(); - sal_Int32 nPos = 0; - - pDesc[nPos++] = css::beans::Property(PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::BOUND); - - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); + css::uno::Sequence< css::beans::Property> aDescriptor + { + { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND }, + { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::BOUND} + }; Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx index c3628d887ac7..693e1ad3dd75 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.cxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/sdbc/SQLException.hpp> +#include <utility> using namespace dbaccess; using namespace comphelper; @@ -34,7 +35,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::util; using namespace cppu; using namespace osl; @@ -44,13 +44,13 @@ ORowSetDataColumn::ORowSetDataColumn( const Reference < XResultSetMetaData >& _x const Reference < XRowUpdate >& _xRowUpdate, sal_Int32 _nPos, const Reference< XDatabaseMetaData >& _rxDBMeta, - const OUString& _rDescription, - const OUString& i_sLabel, - const std::function<const ORowSetValue& (sal_Int32)> &_getValue) + OUString i_sDescription, + OUString i_sLabel, + std::function<const ORowSetValue& (sal_Int32)> _getValue) :ODataColumn(_xMetaData,_xRow,_xRowUpdate,_nPos,_rxDBMeta) - ,m_pGetValue(_getValue) - ,m_sLabel(i_sLabel) - ,m_aDescription(_rDescription) + ,m_pGetValue(std::move(_getValue)) + ,m_sLabel(std::move(i_sLabel)) + ,m_aDescription(std::move(i_sDescription)) { OColumnSettings::registerProperties( *this ); registerProperty( PROPERTY_DESCRIPTION, PROPERTY_ID_DESCRIPTION, PropertyAttribute::READONLY, &m_aDescription, cppu::UnoType<decltype(m_aDescription)>::get() ); @@ -63,32 +63,30 @@ ORowSetDataColumn::~ORowSetDataColumn() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSetDataColumn::createArrayHelper( ) const { - css::uno::Sequence< css::beans::Property> aDescriptor(21); - css::beans::Property* pDesc = aDescriptor.getArray(); - sal_Int32 nPos = 0; - pDesc[nPos++] = css::beans::Property(PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY ); - pDesc[nPos++] = css::beans::Property(PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::BOUND ); - - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); + css::uno::Sequence< css::beans::Property> aDescriptor + { + { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::BOUND }, + { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_VALUE, PROPERTY_ID_VALUE, cppu::UnoType<Any>::get(), css::beans::PropertyAttribute::BOUND } + }; Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); @@ -194,12 +192,12 @@ void ORowSetDataColumn::fireValueChange(const ORowSetValue& _rOldValue) ORowSetDataColumns::ORowSetDataColumns( bool _bCase, - const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns, + ::rtl::Reference< ::connectivity::OSQLColumns> _xColumns, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const std::vector< OUString> &_rVector ) : connectivity::sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector) - ,m_aColumns(_rColumns) + ,m_aColumns(std::move(_xColumns)) { } diff --git a/dbaccess/source/core/api/CRowSetDataColumn.hxx b/dbaccess/source/core/api/CRowSetDataColumn.hxx index f0efcbf8d85c..a19aad8497e5 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.hxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.hxx @@ -49,9 +49,9 @@ namespace dbaccess const css::uno::Reference < css::sdbc::XRowUpdate >& _xRowUpdate, sal_Int32 _nPos, const css::uno::Reference< css::sdbc::XDatabaseMetaData >& _rxDBMeta, - const OUString& _rDescription, - const OUString& i_sLabel, - const std::function<const ::connectivity::ORowSetValue& (sal_Int32)> &_getValue); + OUString i_sDescription, + OUString i_sLabel, + std::function<const ::connectivity::ORowSetValue& (sal_Int32)> _getValue); // css::lang::XTypeProvider @@ -84,7 +84,7 @@ namespace dbaccess public: ORowSetDataColumns( bool _bCase, - const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns, + ::rtl::Reference< ::connectivity::OSQLColumns> _xColumns, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const std::vector< OUString> &_rVector diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 366a727be58d..dd266949cb7f 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -36,7 +36,7 @@ #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <osl/diagnose.h> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> using namespace comphelper; @@ -50,7 +50,6 @@ using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::io; -using namespace ::osl; OCacheSet::OCacheSet(sal_Int32 i_nMaxRows) @@ -167,7 +166,7 @@ void OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQ aSql[aSql.getLength() - 1] = ')'; aValues[aValues.getLength() - 1] = ')'; - aSql.append(aValues.makeStringAndClear()); + aSql.append(aValues); // now create end execute the prepared statement { Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear())); @@ -282,7 +281,7 @@ void OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOri { aCondition.setLength(aCondition.getLength()-5); - aSql.append(" WHERE " + aCondition.makeStringAndClear()); + aSql.append(" WHERE " + aCondition); } else ::dbtools::throwSQLException( diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 70eb85210a80..955a7f1c222f 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -26,7 +26,7 @@ #include <comphelper/types.hxx> #include <connectivity/dbtools.hxx> #include <tools/wldcrd.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <optional> #include <sal/log.hxx> @@ -34,12 +34,8 @@ namespace dbaccess { using namespace dbtools; using namespace ::com::sun::star::uno; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; - using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::sdbcx; - using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::osl; using namespace ::comphelper; @@ -132,7 +128,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: static void lcl_ensureComposedName( TableInfo& _io_tableInfo, const Reference< XDatabaseMetaData >& _metaData ) { if ( !_metaData.is() ) - throw RuntimeException(); + throw RuntimeException("lcl_ensureComposedName: _metaData cannot be null!"); if ( !_io_tableInfo.sComposedName ) { @@ -153,7 +149,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: lcl_ensureComposedName( _io_tableInfo, _metaData ); if ( !_masterContainer.is() ) - throw RuntimeException(); + throw RuntimeException("lcl_ensureType: _masterContainer cannot be null!"); OUString sTypeName; try @@ -341,7 +337,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: } } - static constexpr OUStringLiteral sAll = u"%"; + static constexpr OUString sAll = u"%"_ustr; Reference< XResultSet > xTables = m_xMetaData->getTables( Any(), sAll, sAll, aTableTypeFilter ); Reference< XRow > xCurrentRow( xTables, UNO_QUERY_THROW ); @@ -430,9 +426,9 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: OSL_VERIFY( aFilterModeSetting >>= nFilterMode ); } - static const OUStringLiteral sAll( u"%" ); - static const OUStringLiteral sView( u"VIEW" ); - static const OUStringLiteral sTable( u"TABLE" ); + static constexpr OUString sAll( u"%"_ustr ); + static constexpr OUString sView( u"VIEW"_ustr ); + static constexpr OUString sTable( u"TABLE"_ustr ); switch ( nFilterMode ) { diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx index dfc18badc688..2a04b632a7ce 100644 --- a/dbaccess/source/core/api/HelperCollections.cxx +++ b/dbaccess/source/core/api/HelperCollections.cxx @@ -20,6 +20,7 @@ #include "HelperCollections.hxx" #include <strings.hxx> +#include <utility> #include <osl/diagnose.h> @@ -30,23 +31,19 @@ namespace dbaccess using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::sdbcx; - using namespace ::com::sun::star::container; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::script; using namespace ::cppu; using namespace ::osl; - OPrivateColumns::OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns, + OPrivateColumns::OPrivateColumns(::rtl::Reference< ::connectivity::OSQLColumns> _xColumns, bool _bCase, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, const std::vector< OUString> &_rVector, bool _bUseAsIndex ) : sdbcx::OCollection(_rParent,_bCase,_rMutex,_rVector,_bUseAsIndex) - ,m_aColumns(_rColumns) + ,m_aColumns(std::move(_xColumns)) { } diff --git a/dbaccess/source/core/api/HelperCollections.hxx b/dbaccess/source/core/api/HelperCollections.hxx index ed89fc643054..2c066064de54 100644 --- a/dbaccess/source/core/api/HelperCollections.hxx +++ b/dbaccess/source/core/api/HelperCollections.hxx @@ -25,15 +25,10 @@ namespace dbaccess { using namespace dbtools; - using namespace comphelper; using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; - using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; - using namespace ::com::sun::star::sdbcx; - using namespace ::com::sun::star::container; - using namespace ::com::sun::star::lang; using namespace ::com::sun::star::script; using namespace ::cppu; using namespace ::osl; @@ -50,7 +45,7 @@ namespace dbaccess return nullptr; } public: - OPrivateColumns(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns, + OPrivateColumns(::rtl::Reference< ::connectivity::OSQLColumns> _xColumns, bool _bCase, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, @@ -83,7 +78,7 @@ namespace dbaccess return nullptr; } public: - OPrivateTables( const OSQLTables& _rTables, + OPrivateTables( OSQLTables _rTables, bool _bCase, ::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 847a9c1a07cc..4ef85e0ce1af 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <composertools.hxx> +#include <utility> #include "PrivateRow.hxx" using namespace dbaccess; @@ -62,7 +63,6 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::io; using namespace ::com::sun::star; using namespace ::cppu; -using namespace ::osl; using std::vector; namespace @@ -103,17 +103,17 @@ namespace } -OKeySet::OKeySet(const connectivity::OSQLTable& _xTable, - const OUString& _rUpdateTableName, // this can be the alias or the full qualified name +OKeySet::OKeySet(connectivity::OSQLTable _xTable, + OUString _sUpdateTableName, // this can be the alias or the full qualified name const Reference< XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, sal_Int32 i_nMaxRows, sal_Int32& o_nRowCount) :OCacheSet(i_nMaxRows) ,m_aParameterValueForCache(new ORowSetValueVector(_aParameterValueForCache)) - ,m_xTable(_xTable) + ,m_xTable(std::move(_xTable)) ,m_xComposer(_xComposer) - ,m_sUpdateTableName(_rUpdateTableName) + ,m_sUpdateTableName(std::move(_sUpdateTableName)) ,m_rRowCount(o_nRowCount) ,m_bRowCountFinal(false) { @@ -282,7 +282,7 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet, const OUStrin Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); Reference<XColumnsSupplier> xQueryColSup(m_xComposer, UNO_QUERY); const Reference<XNameAccess> xQueryColumns = xQueryColSup->getColumns(); - findTableColumnsMatching_throw( makeAny(m_xTable), m_sUpdateTableName, xMeta, xQueryColumns, m_pKeyColumnNames ); + findTableColumnsMatching_throw( Any(m_xTable), m_sUpdateTableName, xMeta, xQueryColumns, m_pKeyColumnNames ); Reference< XSingleSelectQueryComposer> xSourceComposer(m_xComposer,UNO_QUERY); Reference< XMultiServiceFactory > xFactory(m_xConnection, UNO_QUERY_THROW); @@ -406,7 +406,7 @@ Any OKeySet::getBookmark() { OSL_ENSURE(m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin(), "getBookmark is only possible when we stand on a valid row!"); - return makeAny(m_aKeyIter->first); + return Any(m_aKeyIter->first); } bool OKeySet::moveToBookmark( const Any& bookmark ) @@ -446,7 +446,7 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi // list all columns that should be set constexpr OUStringLiteral aPara(u" = ?,"); OUString aQuote = getIdentifierQuoteString(); - constexpr OUStringLiteral aAnd(u" AND "); + constexpr OUString aAnd(u" AND "_ustr); OUString sIsNull(" IS NULL"); OUString sParam(" = ?"); @@ -463,7 +463,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi std::vector<sal_Int32> aIndexColumnPositions; const sal_Int32 nOldLength = aSql.getLength(); - sal_Int32 i = 1; // here we build the condition part for the update statement for (auto const& columnName : *m_pColumnNames) { @@ -499,7 +498,6 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi { aSql.append(::dbtools::quoteName( aQuote,columnName.second.sRealName) + aPara); } - ++i; } if( aSql.getLength() != nOldLength ) @@ -514,15 +512,15 @@ void OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrigi aSql.append(" WHERE "); if(!sKeyCondition.isEmpty() && !sIndexCondition.isEmpty()) { - aSql.append(sKeyCondition.makeStringAndClear() + sIndexCondition.makeStringAndClear()); + aSql.append(sKeyCondition + sIndexCondition); } else if(!sKeyCondition.isEmpty()) { - aSql.append(sKeyCondition.makeStringAndClear()); + aSql.append(sKeyCondition); } else if(!sIndexCondition.isEmpty()) { - aSql.append(sIndexCondition.makeStringAndClear()); + aSql.append(sIndexCondition); } aSql.setLength(aSql.getLength()-5); // remove the last AND } @@ -540,7 +538,6 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO Reference< XParameters > xParameter(xPrep,UNO_QUERY); bool bRefetch = true; - Reference<XRow> xRow; sal_Int32 i = 1; // first the set values for (auto const& columnName : *m_pColumnNames) @@ -584,8 +581,9 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO { const sal_Int32 nBookmark = ::comphelper::getINT32((*_rInsertRow)[0].getAny()); m_aKeyIter = m_aKeyMap.find(nBookmark); + assert(m_aKeyIter != m_aKeyMap.end()); m_aKeyIter->second.second.first = 2; - m_aKeyIter->second.second.second = xRow; + m_aKeyIter->second.second.second.clear(); copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark); tryRefetch(_rInsertRow,bRefetch); } @@ -622,7 +620,7 @@ void OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLT aSql[aSql.getLength() - 1] = ')'; aValues[aValues.getLength() - 1] = ')'; - aSql.append(aValues.makeStringAndClear()); + aSql.append(aValues); // now create,fill and execute the prepared statement executeInsert(_rInsertRow,aSql.makeStringAndClear(),u"",bRefetch); } @@ -725,7 +723,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ if(!sMaxStmt.isEmpty()) { sMaxStmt[sMaxStmt.getLength()-1] = ' '; - OUString sStmt = "SELECT " + sMaxStmt.makeStringAndClear() + "FROM "; + OUString sStmt = "SELECT " + sMaxStmt + "FROM "; OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(m_xConnection->getMetaData(),m_sUpdateTableName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation); sStmt += ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); @@ -763,7 +761,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const OUString& i_sSQ m_aKeyIter = m_aKeyMap.emplace( aKeyIter->first + 1, OKeySetValue(aKeyRow,std::pair<sal_Int32,Reference<XRow> >(1,Reference<XRow>())) ).first; // now we set the bookmark for this row - (*_rInsertRow)[0] = makeAny(static_cast<sal_Int32>(m_aKeyIter->first)); + (*_rInsertRow)[0] = Any(static_cast<sal_Int32>(m_aKeyIter->first)); tryRefetch(_rInsertRow,bRefetch); } } @@ -886,7 +884,7 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa } } } - aSql.append(sIndexCondition.makeStringAndClear()); + aSql.append(sIndexCondition); aSql.setLength(aSql.getLength()-5); // now create end execute the prepared statement @@ -912,7 +910,9 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa if(m_bDeleted) { sal_Int32 nBookmark = ::comphelper::getINT32((*_rDeleteRow)[0].getAny()); - if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != m_aKeyMap.end()) + const auto iter = m_aKeyMap.find(nBookmark); + assert(iter != m_aKeyMap.end()); + if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end()) ++m_aKeyIter; m_aKeyMap.erase(nBookmark); m_bDeleted = true; @@ -1381,7 +1381,7 @@ namespace dbaccess void getColumnPositions(const Reference<XNameAccess>& _rxQueryColumns, const css::uno::Sequence< OUString >& _aColumnNames, - const OUString& _rsUpdateTableName, + std::u16string_view _rsUpdateTableName, SelectColumnsMetaData& o_rColumnNames, bool i_bAppendTableName) { diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index e5d3c61ea5ac..bd30f3960eb3 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -23,6 +23,7 @@ #include <memory> #include <map> +#include <utility> #include <vector> #include <com/sun/star/sdb/XSingleSelectQueryAnalyzer.hpp> @@ -49,8 +50,8 @@ namespace dbaccess { } - SelectColumnDescription( sal_Int32 _nPosition, sal_Int32 _nType, sal_Int32 _nScale,bool _bNullable, const OUString& _rDefaultValue ) - :sDefaultValue( _rDefaultValue ) + SelectColumnDescription( sal_Int32 _nPosition, sal_Int32 _nType, sal_Int32 _nScale, bool _bNullable, OUString _sDefaultValue ) + :sDefaultValue(std::move( _sDefaultValue )) ,nPosition( _nPosition ) ,nType( _nType ) ,nScale( _nScale ) @@ -63,7 +64,7 @@ namespace dbaccess // the elements of _rxQueryColumns must have the properties PROPERTY_REALNAME and PROPERTY_TABLENAME void getColumnPositions(const css::uno::Reference< css::container::XNameAccess >& _rxQueryColumns, const css::uno::Sequence< OUString >& _rColumnNames, - const OUString& _rsUpdateTableName, + std::u16string_view _rsUpdateTableName, SelectColumnsMetaData& o_rColumnNames /* out */, bool i_bAppendTableName = false); @@ -142,8 +143,8 @@ namespace dbaccess virtual ~OKeySet() override; public: - OKeySet(const connectivity::OSQLTable& _xTable, - const OUString& _rUpdateTableName, + OKeySet(connectivity::OSQLTable _aTable, + OUString _sUpdateTableName, const css::uno::Reference< css::sdb::XSingleSelectQueryAnalyzer >& _xComposer, const ORowSetValueVector& _aParameterValueForCache, sal_Int32 i_nMaxRows, diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx index a95384eed2b7..df09d7b77588 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -41,17 +41,13 @@ using namespace dbaccess; using namespace ::connectivity; using namespace ::dbtools; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::util; using namespace ::com::sun::star::io; using namespace ::com::sun::star; -using namespace ::cppu; -using namespace ::osl; typedef std::map<OUString, OUStringBuffer> TSQLStatements; namespace @@ -353,7 +349,9 @@ void OptimisticSet::executeDelete(const ORowSetRow& _rDeleteRow,const OUString& if(m_bDeleted) { sal_Int32 nBookmark = ::comphelper::getINT32((*_rDeleteRow)[0].getAny()); - if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != m_aKeyMap.end()) + const auto iter = m_aKeyMap.find(nBookmark); + assert(iter != m_aKeyMap.end()); + if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end()) ++m_aKeyIter; m_aKeyMap.erase(nBookmark); m_bDeleted = true; @@ -544,8 +542,8 @@ void OptimisticSet::fillMissingValues(ORowSetValueVector::Vector& io_aRow) const OUString sCatalog,sSchema,sTable; ::dbtools::qualifiedNameComponents(xMetaData,elem.first,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation); OUString sComposedTableName = ::dbtools::composeTableNameForSelect( m_xConnection, sCatalog, sSchema, sTable ); - OUString sQuery("SELECT " + elem.second + " FROM " + sComposedTableName + " WHERE " + - rCondition.makeStringAndClear()); + OUString sQuery("SELECT " + elem.second + " FROM " + sComposedTableName + " WHERE " + rCondition); + rCondition.setLength(0); try { diff --git a/dbaccess/source/core/api/PrivateRow.cxx b/dbaccess/source/core/api/PrivateRow.cxx index 9bf2709606bd..7e2df82aaeed 100644 --- a/dbaccess/source/core/api/PrivateRow.cxx +++ b/dbaccess/source/core/api/PrivateRow.cxx @@ -21,12 +21,9 @@ using namespace dbaccess; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; -using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; using namespace ::com::sun::star; diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index d22717c263b0..d9904071d64b 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -70,9 +70,8 @@ #include <i18nlangtag/languagetag.hxx> #include <o3tl/safeint.hxx> #include <unotools/syslocale.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> -using namespace utl; using namespace dbaccess; using namespace connectivity; using namespace comphelper; @@ -419,18 +418,6 @@ void SAL_CALL ORowSet::release() noexcept ORowSet_BASE1::release(); } -// css::XUnoTunnel -sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this); -} - -Sequence< sal_Int8 > ORowSet::getUnoTunnelId() -{ - static const comphelper::UnoIdInit s_Id; - return s_Id.getSeq(); -} - // css::XAggregation Any SAL_CALL ORowSet::queryAggregation( const Type& rType ) { @@ -618,7 +605,7 @@ void SAL_CALL ORowSet::close( ) MutexGuard aGuard( m_aMutex ); ::connectivity::checkDisposed(ORowSet_BASE1::rBHelper.bDisposed); } - // additionals things to set + // additional things to set freeResources( true ); } @@ -974,7 +961,7 @@ void SAL_CALL ORowSet::deleteRow( ) // this call position the cache indirect Any aBookmarkToDelete( m_aBookmark ); - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); sal_Int32 nDeletePosition = m_pCache->getRow(); notifyRowSetAndClonesRowDelete( aBookmarkToDelete ); @@ -1021,7 +1008,7 @@ void ORowSet::implCancelRowUpdates( bool _bNotifyModified ) if ( m_bNew || m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) throwFunctionSequenceException(*this); - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); ORowSetRow aOldValues; if ( !m_bModified && _bNotifyModified && !m_aCurrentRow.isNull() ) @@ -1171,12 +1158,12 @@ void SAL_CALL ORowSet::moveToInsertRow( ) ORowSetRow aOldValues; if ( rowDeleted() ) { - positionCache( MOVE_FORWARD ); + positionCache( CursorMoveDirection::Forward ); m_pCache->next(); setCurrentRow( true, false, aOldValues, aGuard); } else - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); // check before because the resultset could be empty if ( !m_bBeforeFirst @@ -1226,18 +1213,18 @@ void ORowSet::impl_setDataColumnsWriteable_throw() dataColumn->getPropertyValue(PROPERTY_ISREADONLY) >>= bReadOnly; *aReadIter = bReadOnly; - dataColumn->setPropertyValue(PROPERTY_ISREADONLY,makeAny(false)); + dataColumn->setPropertyValue(PROPERTY_ISREADONLY,Any(false)); ++aReadIter; } } void ORowSet::impl_restoreDataColumnsWriteable_throw() { - assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.size() == 0 ); + assert(m_aDataColumns.size() == m_aReadOnlyDataColumns.size() || m_aReadOnlyDataColumns.empty()); TDataColumns::const_iterator aIter = m_aDataColumns.begin(); for (bool readOnlyDataColumn : m_aReadOnlyDataColumns) { - (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, makeAny(readOnlyDataColumn) ); + (*aIter)->setPropertyValue(PROPERTY_ISREADONLY, Any(readOnlyDataColumn) ); ++aIter; } m_aReadOnlyDataColumns.clear(); @@ -1265,7 +1252,7 @@ void SAL_CALL ORowSet::moveToCurrentRow( ) if ( !notifyAllListenersCursorBeforeMove( aGuard ) ) return; - positionCache( MOVE_NONE_REFRESH ); + positionCache( CursorMoveDirection::CurrentRefresh ); ORowSetNotifier aNotifier( this ); @@ -1616,8 +1603,8 @@ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxSta } } - _rxStatement->setPropertyValue( PROPERTY_RESULTSETTYPE, makeAny( nResultSetType ) ); - _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, makeAny( nResultSetConcurrency ) ); + _rxStatement->setPropertyValue( PROPERTY_RESULTSETTYPE, Any( nResultSetType ) ); + _rxStatement->setPropertyValue( PROPERTY_RESULTSETCONCURRENCY, Any( nResultSetConcurrency ) ); } void ORowSet::impl_ensureStatement_throw() @@ -1644,8 +1631,8 @@ void ORowSet::impl_ensureStatement_throw() // set the result set type and concurrency try { - xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, makeAny( true ) ); - xStatementProps->setPropertyValue( PROPERTY_MAXROWS, makeAny( m_nMaxRows ) ); + xStatementProps->setPropertyValue( PROPERTY_USEBOOKMARKS, Any( true ) ); + xStatementProps->setPropertyValue( PROPERTY_MAXROWS, Any( m_nMaxRows ) ); setStatementResultSetType( xStatementProps, m_nResultSetType, m_nResultSetConcurrency ); } @@ -1662,8 +1649,7 @@ void ORowSet::impl_ensureStatement_throw() // append information about what we were actually going to execute OUString sInfo(m_sErrorString.replaceFirst("$command$", sCommandToExecute)); - css::uno::Any aAppend = SQLExceptionInfo::createException(SQLExceptionInfo::TYPE::SQLContext, sInfo, OUString(), 0); - pLastExceptionInChain->NextException = aAppend; + pLastExceptionInChain->NextException = SQLExceptionInfo::createException(SQLExceptionInfo::TYPE::SQLContext, sInfo, OUString(), 0); // propagate throw; @@ -1720,8 +1706,8 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS // a number of properties is plain copied const OUString aPropertyNames[] = { - OUString(PROPERTY_ALIGN), OUString(PROPERTY_RELATIVEPOSITION), OUString(PROPERTY_WIDTH), OUString(PROPERTY_HIDDEN), OUString(PROPERTY_CONTROLMODEL), - OUString(PROPERTY_HELPTEXT), OUString(PROPERTY_CONTROLDEFAULT) + PROPERTY_ALIGN, PROPERTY_RELATIVEPOSITION, PROPERTY_WIDTH, PROPERTY_HIDDEN, PROPERTY_CONTROLMODEL, + PROPERTY_HELPTEXT, PROPERTY_CONTROLDEFAULT }; for (const auto & aPropertyName : aPropertyNames) { @@ -1741,7 +1727,7 @@ void ORowSet::impl_initializeColumnSettings_nothrow( const Reference< XPropertyS } if ( !nFormatKey && m_xNumberFormatTypes.is() ) nFormatKey = ::dbtools::getDefaultNumberFormat( _rxTemplateColumn, m_xNumberFormatTypes, SvtSysLocale().GetLanguageTag().getLocale() ); - _rxRowSetColumn->setPropertyValue( PROPERTY_NUMBERFORMAT, makeAny( nFormatKey ) ); + _rxRowSetColumn->setPropertyValue( PROPERTY_NUMBERFORMAT, Any( nFormatKey ) ); } catch(Exception&) { @@ -1873,7 +1859,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi aNames.push_back(sName); m_aDataColumns.push_back(pColumn.get()); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i+1) != rKeyColumns.end())); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i+1) != rKeyColumns.end())); try { @@ -1882,10 +1868,10 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi nFormatKey = ::dbtools::getDefaultNumberFormat(pColumn,m_xNumberFormatTypes,aLocale); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey)); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,makeAny(sal_Int32(i+1))); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,makeAny(sal_Int32(227))); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,makeAny(sal_Int32(0))); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,Any(sal_Int32(i+1))); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,Any(sal_Int32(227))); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ALIGN,Any(sal_Int32(0))); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN, css::uno::Any(false)); } catch(Exception&) @@ -1973,7 +1959,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi }); aColumns->emplace_back(pColumn); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,makeAny(rKeyColumns.find(i) != rKeyColumns.end())); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_ISREADONLY,Any(rKeyColumns.find(i) != rKeyColumns.end())); if(sColumnLabel.isEmpty()) { @@ -2071,7 +2057,7 @@ Reference< XResultSet > SAL_CALL ORowSet::createResultSet( ) if(m_xStatement.is()) { rtl::Reference<ORowSetClone> pClone = new ORowSetClone( m_aContext, *this, m_pMutex ); - m_aClones.emplace_back(static_cast<cppu::OWeakObject*>(pClone.get())); + m_aClones.emplace_back(css::uno::Reference< css::uno::XWeak >(pClone)); return pClone; } return Reference< XResultSet >(); @@ -2145,7 +2131,7 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) // notify the clones for (auto const& elem : m_aClones) { - auto pClone = comphelper::getFromUnoTunnel<ORowSetClone>(elem.get()); + rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(elem.get().get()); if(pClone) pClone->onDeleteRow( _rBookmark ); } @@ -2158,7 +2144,7 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 // notify the clones for (auto const& clone : m_aClones) { - auto pClone = comphelper::getFromUnoTunnel<ORowSetClone>(clone.get()); + rtl::Reference<ORowSetClone> pClone = dynamic_cast<ORowSetClone*>(clone.get().get()); if(pClone) pClone->onDeletedRow( _rBookmark, _nPos ); } @@ -2701,7 +2687,7 @@ void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) if ( m_aCurrentRow.isNull() ) ::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_CURSOR_STATE ), StandardSQLState::INVALID_CURSOR_STATE, *this ); - if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->size()) <= columnIndex ) + if ( columnIndex <= 0 || (*m_aCurrentRow)->size() <= o3tl::make_unsigned(columnIndex) ) ::dbtools::throwSQLException( DBA_RES( RID_STR_INVALID_INDEX ), StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this ); } @@ -2737,7 +2723,7 @@ void ORowSet::impl_rebuild_throw(::osl::ResettableMutexGuard& _rGuard) ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowSet& rParent, ::osl::Mutex* _pMutex ) :OSubComponent(m_aMutex, rParent) - ,ORowSetBase( _rContext, OComponentHelper::rBHelper, _pMutex ) + ,ORowSetBase( _rContext, WeakComponentImplHelper::rBHelper, _pMutex ) ,m_pParent(&rParent) ,m_nFetchDirection(rParent.m_nFetchDirection) ,m_nFetchSize(rParent.m_nFetchSize) @@ -2797,7 +2783,7 @@ ORowSetClone::ORowSetClone( const Reference<XComponentContext>& _rContext, ORowS xColumn->getPropertyValue(PROPERTY_NUMBERFORMAT) >>= nFormatKey; if(!nFormatKey && xColumn.is() && m_xNumberFormatTypes.is()) nFormatKey = ::dbtools::getDefaultNumberFormat(xColumn,m_xNumberFormatTypes,aLocale); - pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,makeAny(nFormatKey)); + pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_NUMBERFORMAT,Any(nFormatKey)); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_RELATIVEPOSITION,xColumn->getPropertyValue(PROPERTY_RELATIVEPOSITION)); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_WIDTH,xColumn->getPropertyValue(PROPERTY_WIDTH)); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HIDDEN,xColumn->getPropertyValue(PROPERTY_HIDDEN)); @@ -2883,8 +2869,8 @@ void ORowSetClone::close() { { MutexGuard aGuard( m_aMutex ); - if (OComponentHelper::rBHelper.bDisposed) - throw DisposedException(); + if (WeakComponentImplHelper::rBHelper.bDisposed) + return; } dispose(); } @@ -2903,18 +2889,6 @@ void ORowSetClone::close() return *::comphelper::OPropertyArrayUsageHelper<ORowSetClone>::getArrayHelper(); } -Sequence< sal_Int8 > ORowSetClone::getUnoTunnelId() -{ - static const comphelper::UnoIdInit implId; - return implId.getSeq(); -} - -// css::XUnoTunnel -sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this); -} - void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue) { if ( nHandle == PROPERTY_ID_FETCHSIZE ) diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index da4da6c24e01..3cf6fe690193 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -255,10 +255,6 @@ namespace dbaccess virtual void SAL_CALL acquire() noexcept override; virtual void SAL_CALL release() noexcept override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - // css::uno::XAggregation virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& aType ) override; @@ -487,10 +483,6 @@ namespace dbaccess virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - // OComponentHelper virtual void SAL_CALL disposing() override; diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index cae0d29eb3b7..042f1fabc2d0 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -34,7 +34,7 @@ #include <comphelper/seqstream.hxx> #include <connectivity/dbexception.hxx> #include <o3tl/safeint.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> using namespace dbaccess; using namespace connectivity; @@ -94,7 +94,7 @@ ORowSetBase::ORowSetBase( const Reference<XComponentContext>& _rContext, ::cppu: { sal_Int32 nRBT = PropertyAttribute::READONLY | PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT; - registerPropertyNoMember( PROPERTY_ROWCOUNT, PROPERTY_ID_ROWCOUNT, nRBT, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0) ); + registerPropertyNoMember( PROPERTY_ROWCOUNT, PROPERTY_ID_ROWCOUNT, nRBT, cppu::UnoType<sal_Int32>::get(), css::uno::Any(sal_Int32(0)) ); registerPropertyNoMember( PROPERTY_ISROWCOUNTFINAL, PROPERTY_ID_ISROWCOUNTFINAL, nRBT, cppu::UnoType<bool>::get(), css::uno::Any(false) ); } @@ -207,7 +207,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) if ( !bValidCurrentRow ) { // currentrow is null when the clone moves the window - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); m_aCurrentRow = m_pCache->m_aMatrixIter; m_bIsInsertRow = false; OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getValue: we don't stand on a valid row! Row is null."); @@ -228,7 +228,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) for (; k != m_pCache->getEnd(); ++k) { ORowSetValueVector* pTemp = k->get(); - OSL_ENSURE( pTemp != reinterpret_cast<void*>(0xfeeefeee),"HALT!" ); + OSL_ENSURE( pTemp != reinterpret_cast<void*>(sal_uIntPtr(0xfeeefeee)),"HALT!" ); } OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow < m_pCache->getEnd() && aCacheIter != m_pCache->m_aCacheIterators.end(),"Invalid iterator set for currentrow!"); #endif @@ -338,7 +338,7 @@ Reference< css::io::XInputStream > SAL_CALL ORowSetBase::getBinaryStream( sal_In bool bValidCurrentRow = ( !m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd() && m_aCurrentRow->is() ); if ( !bValidCurrentRow ) { - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); m_aCurrentRow = m_pCache->m_aMatrixIter; m_bIsInsertRow = false; OSL_ENSURE(!m_aCurrentRow.isNull(),"ORowSetBase::getBinaryStream: we don't stand on a valid row! Row is null."); @@ -579,7 +579,7 @@ sal_Bool SAL_CALL ORowSetBase::next( ) ORowSetRow aOldValues = getOldRow(bWasNew); - positionCache( MOVE_FORWARD ); + positionCache( CursorMoveDirection::Forward ); bool bAfterLast = m_pCache->isAfterLast(); bRet = m_pCache->next(); doCancelModification( ); @@ -662,7 +662,7 @@ sal_Bool SAL_CALL ORowSetBase::isFirst( ) if ( impl_rowDeleted() ) return ( m_nDeletedPosition == 1 ); - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); bool bIsFirst = m_pCache->isFirst(); SAL_INFO("dbaccess", "ORowSetBase::isFirst() = " << bIsFirst << " Clone = " << m_bClone); @@ -692,7 +692,7 @@ sal_Bool SAL_CALL ORowSetBase::isLast( ) return ( m_nDeletedPosition == impl_getRowCount() ); } - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); bool bIsLast = m_pCache->isLast(); SAL_INFO("dbaccess", "ORowSetBase::isLast() = " << bIsLast << " Clone = " << m_bClone); @@ -864,7 +864,7 @@ sal_Int32 ORowSetBase::impl_getRow() nPos = 0; else { - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); nPos = m_pCache->getRow(); } SAL_INFO("dbaccess", "ORowSetBase::impl_getRow() = " << nPos << " Clone = " << m_bClone); @@ -944,7 +944,7 @@ sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) ORowSetRow aOldValues = getOldRow(bWasNew); - positionCache( rows > 0 ? MOVE_FORWARD : MOVE_BACKWARD ); + positionCache( rows > 0 ? CursorMoveDirection::Forward : CursorMoveDirection::Backward ); bRet = m_pCache->relative(rows); doCancelModification( ); @@ -992,7 +992,7 @@ sal_Bool SAL_CALL ORowSetBase::previous( ) ORowSetRow aOldValues = getOldRow(bWasNew); - positionCache( MOVE_BACKWARD ); + positionCache( CursorMoveDirection::Backward ); bRet = m_pCache->previous(); doCancelModification( ); @@ -1095,7 +1095,7 @@ void SAL_CALL ORowSetBase::refreshRow( ) { bool bWasNew = m_pCache->m_bNew || impl_rowDeleted(); ORowSetRow aOldValues = getOldRow(bWasNew); - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); m_pCache->refreshRow(); firePropertyChange(aOldValues); } @@ -1213,8 +1213,8 @@ bool ORowSetBase::isPropertyChangeNotificationEnabled() const void ORowSetBase::fireProperty( sal_Int32 _nProperty, bool _bNew, bool _bOld ) { - Any aNew = css::uno::makeAny( _bNew ); - Any aOld = css::uno::makeAny( _bOld ); + Any aNew( _bNew ); + Any aOld( _bOld ); fire( &_nProperty, &aNew, &aOld, 1, false ); } @@ -1225,7 +1225,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) bool bSuccess = false; if ( m_aBookmark.hasValue() ) { - if (_ePrepareForDirection == MOVE_NONE_REFRESH || + if (_ePrepareForDirection == CursorMoveDirection::CurrentRefresh || (m_pCache->isAfterLast() != bool(isAfterLast())) || ( m_pCache->isBeforeFirst() != bool(isBeforeFirst()) ) || m_pCache->compareBookmarks( m_aBookmark, m_pCache->getBookmark() ) != CompareBookmark::EQUAL ) bSuccess = m_pCache->moveToBookmark( m_aBookmark ); @@ -1249,7 +1249,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) OSL_ENSURE( m_nDeletedPosition >= 1, "ORowSetBase::positionCache: no bookmark, and no valid 'deleted position'!" ); switch ( _ePrepareForDirection ) { - case MOVE_FORWARD: + case CursorMoveDirection::Forward: if ( m_nDeletedPosition > 1 ) bSuccess = m_pCache->absolute( m_nDeletedPosition - 1 ); else @@ -1259,7 +1259,7 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) } break; - case MOVE_BACKWARD: + case CursorMoveDirection::Backward: if ( m_pCache->m_bRowCountFinal && ( m_nDeletedPosition == impl_getRowCount() ) ) { m_pCache->afterLast(); @@ -1269,8 +1269,8 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) bSuccess = m_pCache->absolute( m_nDeletedPosition ); break; - case MOVE_NONE: - case MOVE_NONE_REFRESH: + case CursorMoveDirection::Current: + case CursorMoveDirection::CurrentRefresh: bSuccess = false; // will be asserted below break; } @@ -1324,7 +1324,7 @@ void ORowSetBase::onDeleteRow( const Any& _rBookmark ) //OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::onDeleteRow: Bookmark isn't valid!" ); if ( compareBookmarks( _rBookmark, m_aBookmark ) == CompareBookmark::EQUAL ) { - positionCache( MOVE_NONE ); + positionCache( CursorMoveDirection::Current ); m_nDeletedPosition = m_pCache->getRow(); } } @@ -1358,12 +1358,6 @@ sal_Int32 ORowSetBase::impl_getRowCount() const return nRowCount; } -struct ORowSetNotifierImpl -{ - std::vector<sal_Int32> aChangedColumns; - ORowSetValueVector::Vector aRow; -}; - ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) :m_pRowSet( _pRowSet ) @@ -1383,14 +1377,12 @@ ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet ) } ORowSetNotifier::ORowSetNotifier( ORowSetBase* _pRowSet, ORowSetValueVector::Vector&& i_aRow ) - :m_pImpl(new ORowSetNotifierImpl) - ,m_pRowSet( _pRowSet ) + :m_pRowSet( _pRowSet ) ,m_bWasNew( false ) ,m_bWasModified( false ) { - OSL_ENSURE( m_pRowSet, "ORowSetNotifier::ORowSetNotifier: invalid row set. This will crash." ); - m_pImpl->aRow = std::move(i_aRow); // yes, create a copy to store the old values + aRow = std::move(i_aRow); // yes, create a copy to store the old values } ORowSetNotifier::~ORowSetNotifier( ) @@ -1413,24 +1405,19 @@ void ORowSetNotifier::fire() m_pRowSet->fireProperty( PROPERTY_ID_ISNEW, false, true, ORowSetBase::GrantNotifierAccess() ); } -std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() const +std::vector<sal_Int32>& ORowSetNotifier::getChangedColumns() { - OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); - return m_pImpl->aChangedColumns; + return aChangedColumns; } void ORowSetNotifier::firePropertyChange() { - OSL_ENSURE(m_pImpl, "Illegal CTor call, use the other one!"); - if (m_pImpl) + for (auto const& changedColumn : aChangedColumns) { - for (auto const& changedColumn : m_pImpl->aChangedColumns) - { - m_pRowSet->firePropertyChange(changedColumn-1 ,m_pImpl->aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess()); - } - if ( !m_pImpl->aChangedColumns.empty() ) - m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess()); + m_pRowSet->firePropertyChange(changedColumn-1, aRow[changedColumn-1], ORowSetBase::GrantNotifierAccess()); } + if ( !aChangedColumns.empty() ) + m_pRowSet->fireProperty(PROPERTY_ID_ISMODIFIED,true,false, ORowSetBase::GrantNotifierAccess()); } } // namespace dbaccess diff --git a/dbaccess/source/core/api/RowSetBase.hxx b/dbaccess/source/core/api/RowSetBase.hxx index f5443a2afcad..13d6464cddbf 100644 --- a/dbaccess/source/core/api/RowSetBase.hxx +++ b/dbaccess/source/core/api/RowSetBase.hxx @@ -19,7 +19,7 @@ #pragma once #include <memory> -#include <cppuhelper/implbase10.hxx> +#include <cppuhelper/implbase9.hxx> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/sdbc/XColumnLocate.hpp> @@ -28,7 +28,6 @@ #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <cppuhelper/interfacecontainer.h> #include <connectivity/sqlerror.hxx> #include <connectivity/CommonTools.hxx> @@ -51,7 +50,7 @@ namespace dbaccess { class OEmptyCollection; - typedef ::cppu::ImplHelper10< css::sdbcx::XRowLocate, + typedef ::cppu::ImplHelper9< css::sdbcx::XRowLocate, css::sdbc::XRow, css::sdbc::XResultSetMetaDataSupplier, css::sdbc::XWarningsSupplier, @@ -59,8 +58,7 @@ namespace dbaccess css::sdbcx::XColumnsSupplier, css::lang::XServiceInfo, css::sdbc::XRowSet, - css::sdbc::XCloseable, - css::lang::XUnoTunnel> ORowSetBase_BASE; + css::sdbc::XCloseable> ORowSetBase_BASE; class ORowSetCache; class ORowSetDataColumns; @@ -143,16 +141,16 @@ namespace dbaccess virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, css::uno::Any& _rDefault ) const override; virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue,sal_Int32 nHandle) const override; - enum CursorMoveDirection + enum class CursorMoveDirection { /// denotes a cursor move forward - MOVE_FORWARD, + Forward, /// denotes a cursor move backwards - MOVE_BACKWARD, + Backward, /// denotes no cursor move at all, but move cache to current row (if it is not there already) - MOVE_NONE, + Current, /// denotes no cursor move at all, but force the cache to move to current row (and refresh the row) - MOVE_NONE_REFRESH + CurrentRefresh }; /** positions the cache in preparation of a cursor move @@ -347,11 +345,11 @@ namespace dbaccess <p>The class can only be used on the stack, within a method of ORowSetBase (or derivees)</p> */ - struct ORowSetNotifierImpl; class ORowSetNotifier { private: - std::unique_ptr<ORowSetNotifierImpl> m_pImpl; + std::vector<sal_Int32> aChangedColumns; + ORowSetValueVector::Vector aRow; ORowSetBase* m_pRowSet; // not acquired! This is not necessary because this class here is to be used on the stack within // a method of ORowSetBase (or derivees) @@ -391,9 +389,9 @@ namespace dbaccess */ void firePropertyChange(); - /** use this one to store the inde of the changed column values + /** use this one to store the index of the changed column values */ - std::vector<sal_Int32>& getChangedColumns() const; + std::vector<sal_Int32>& getChangedColumns(); }; diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 1df68462a444..a41d9e991964 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -45,7 +45,7 @@ #include <connectivity/sqlnode.hxx> #include <connectivity/sqlparse.hxx> #include <sqlbison.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <o3tl/safeint.hxx> #include <osl/diagnose.h> @@ -60,9 +60,7 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; using namespace ::cppu; -using namespace ::osl; // This class calls m_pCacheSet->FOO_checked(..., sal_False) // (where FOO is absolute, last, previous) @@ -207,7 +205,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); SelectColumnsMetaData aColumnNames(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); ::dbaccess::getColumnPositions(xSelColumns,xPrimaryKeyColumns->getElementNames(),aUpdateTableName,aColumnNames); - bAllKeysFound = !aColumnNames.empty() && sal_Int32(aColumnNames.size()) == xPrimaryKeyColumns->getElementNames().getLength(); + bAllKeysFound = !aColumnNames.empty() && aColumnNames.size() == o3tl::make_unsigned(xPrimaryKeyColumns->getElementNames().getLength()); } } } @@ -455,7 +453,7 @@ static Any lcl_getBookmark(ORowSetValue& i_aValue,OCacheSet* i_pCacheSet) case DataType::TINYINT: case DataType::SMALLINT: case DataType::INTEGER: - return makeAny(i_aValue.getInt32()); + return Any(i_aValue.getInt32()); default: if ( i_pCacheSet && i_aValue.isNull()) i_aValue = i_pCacheSet->getBookmark(); @@ -591,7 +589,7 @@ void ORowSetCache::updateCharacterStream( sal_Int32 columnIndex, const Reference rInsert[columnIndex].setBound(true); rInsert[columnIndex] = aSeq; rInsert[columnIndex].setModified(true); - io_aRow[columnIndex] = makeAny(x); + io_aRow[columnIndex] = Any(x); m_xCacheSet->mergeColumnValues(columnIndex,rInsert,io_aRow,o_ChangedColumns); impl_updateRowFromCache_throw(io_aRow,o_ChangedColumns); @@ -946,7 +944,7 @@ void ORowSetCache::moveWindow() if ( nRowsInCache < m_nFetchSize ) { // There is some unused space in *m_pMatrix; fill it - OSL_ENSURE((nRowsInCache >= static_cast<ORowSetMatrix::difference_type>(0)) && (nRowsInCache < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!"); + OSL_ENSURE((nRowsInCache >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nRowsInCache) < m_pMatrix->size()),"Position is invalid!"); sal_Int32 nPos = m_nEndPos + 1; bool bCheck = m_xCacheSet->absolute(nPos); ORowSetMatrix::iterator aIter = m_pMatrix->begin() + nRowsInCache; @@ -964,7 +962,7 @@ void ORowSetCache::moveWindow() // The rows behind this can be reused ORowSetMatrix::iterator aIter = m_pMatrix->begin(); const sal_Int32 nNewStartPosInMatrix = nNewStartPos - m_nStartPos; - OSL_ENSURE((nNewStartPosInMatrix >= static_cast<ORowSetMatrix::difference_type>(0)) && (nNewStartPosInMatrix < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!"); + OSL_ENSURE((nNewStartPosInMatrix >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nNewStartPosInMatrix) < m_pMatrix->size()),"Position is invalid!"); // first position we reuse const ORowSetMatrix::const_iterator aEnd = m_pMatrix->begin() + nNewStartPosInMatrix; // End of used portion of the matrix. Is < m_pMatrix->end() if less data than window size @@ -1623,8 +1621,8 @@ void ORowSetCache::clearInsertRow() ORowSetMatrix::iterator ORowSetCache::calcPosition() const { sal_Int32 nValue = (m_nPosition - m_nStartPos) - 1; - OSL_ENSURE((nValue >= static_cast<ORowSetMatrix::difference_type>(0)) && (nValue < static_cast<sal_Int32>(m_pMatrix->size())),"Position is invalid!"); - return ( nValue < 0 || nValue >= static_cast<sal_Int32>(m_pMatrix->size()) ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue); + OSL_ENSURE((nValue >= static_cast<ORowSetMatrix::difference_type>(0)) && (o3tl::make_unsigned(nValue) < m_pMatrix->size()),"Position is invalid!"); + return ( nValue < 0 || o3tl::make_unsigned(nValue) >= m_pMatrix->size() ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue); } TORowSetOldRowHelperRef ORowSetCache::registerOldRow() diff --git a/dbaccess/source/core/api/RowSetCacheIterator.hxx b/dbaccess/source/core/api/RowSetCacheIterator.hxx index 9c7a9afd4deb..f5d5e6783b65 100644 --- a/dbaccess/source/core/api/RowSetCacheIterator.hxx +++ b/dbaccess/source/core/api/RowSetCacheIterator.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> #include <map> +#include <utility> #include "RowSetRow.hxx" @@ -43,8 +44,8 @@ namespace dbaccess ORowSetCache* m_pCache; ORowSetBase* m_pRowSet; - ORowSetCacheIterator(const ORowSetCacheMap::iterator& _rIter,ORowSetCache* _pCache,ORowSetBase* _pRowSet) - : m_aIter(_rIter) + ORowSetCacheIterator(ORowSetCacheMap::iterator _aIter, ORowSetCache* _pCache,ORowSetBase* _pRowSet) + : m_aIter(std::move(_aIter)) ,m_pCache(_pCache) ,m_pRowSet(_pRowSet) { diff --git a/dbaccess/source/core/api/RowSetRow.hxx b/dbaccess/source/core/api/RowSetRow.hxx index 7f24267b7530..a847399dd1e9 100644 --- a/dbaccess/source/core/api/RowSetRow.hxx +++ b/dbaccess/source/core/api/RowSetRow.hxx @@ -22,6 +22,7 @@ #include <connectivity/CommonTools.hxx> #include <connectivity/FValue.hxx> #include <salhelper/simplereferenceobject.hxx> +#include <utility> namespace dbaccess { @@ -36,8 +37,8 @@ namespace dbaccess ORowSetOldRowHelper& operator=(const ORowSetOldRowHelper& _rRH) = delete; ORowSetOldRowHelper(const ORowSetOldRowHelper& _rRh) = delete; public: - explicit ORowSetOldRowHelper(const ORowSetRow& _rRow) - : m_aRow(_rRow) + explicit ORowSetOldRowHelper(ORowSetRow _aRow) + : m_aRow(std::move(_aRow)) {} const ORowSetRow& getRow() const { return m_aRow; } diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index ab018431c9ce..f6dffbd1314a 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -49,7 +49,7 @@ #include <connectivity/dbtools.hxx> #include <connectivity/PColumn.hxx> #include <connectivity/predicateinput.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> #include <unotools/sharedunocomponent.hxx> @@ -80,15 +80,15 @@ namespace BooleanComparisonMode = ::com::sun::star::sdb::BooleanComparisonMode; constexpr OUStringLiteral STR_SELECT = u"SELECT "; constexpr OUStringLiteral STR_FROM = u" FROM "; -constexpr OUStringLiteral STR_WHERE = u" WHERE "; +constexpr OUString STR_WHERE = u" WHERE "_ustr; constexpr OUStringLiteral STR_GROUP_BY = u" GROUP BY "; constexpr OUStringLiteral STR_HAVING = u" HAVING "; constexpr OUStringLiteral STR_ORDER_BY = u" ORDER BY "; -constexpr OUStringLiteral STR_AND = u" AND "; -constexpr OUStringLiteral STR_OR = u" OR "; +constexpr OUString STR_AND = u" AND "_ustr; +constexpr OUString STR_OR = u" OR "_ustr; constexpr OUStringLiteral STR_LIKE = u" LIKE "; -constexpr OUStringLiteral L_BRACKET = u"("; -constexpr OUStringLiteral R_BRACKET = u")"; +constexpr OUString L_BRACKET = u"("_ustr; +constexpr OUString R_BRACKET = u")"_ustr; constexpr OUStringLiteral COMMA = u","; namespace @@ -106,8 +106,8 @@ namespace { OUString sSQLStateGeneralError( getStandardSQLState( StandardSQLState::GENERAL_ERROR ) ); SQLException aError2( aErrorMsg, _rxContext, sSQLStateGeneralError, 1000, Any() ); - SQLException aError1( _rStatement, _rxContext, sSQLStateGeneralError, 1000, makeAny( aError2 ) ); - throw SQLException(_rParser.getContext().getErrorMessage(OParseContext::ErrorCode::General),_rxContext,sSQLStateGeneralError,1000,makeAny(aError1)); + SQLException aError1( _rStatement, _rxContext, sSQLStateGeneralError, 1000, Any( aError2 ) ); + throw SQLException(_rParser.getContext().getErrorMessage(OParseContext::ErrorCode::General),_rxContext,sSQLStateGeneralError,1000,Any(aError1)); } return pNewSqlParseNode; } @@ -133,7 +133,7 @@ namespace // and now really ... SQLException aError1( _rOriginatingCommand, _rxContext, getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, Any() ); throw SQLException( DBA_RES( RID_STR_ONLY_QUERY ), _rxContext, - getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, makeAny( aError1 ) ); + getStandardSQLState( StandardSQLState::GENERAL_ERROR ), 1000, Any( aError1 ) ); } delete pOldNode; @@ -217,7 +217,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc const Reference<XComponentContext>& _rContext ) :OSubComponent(m_aMutex,_xConnection) ,OPropertyContainer(m_aBHelper) - ,m_aSqlParser( _rContext, &m_aParseContext ) + ,m_aSqlParser( _rContext, &m_aParseContext, &m_aNeutralContext ) ,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser ) ,m_aElementaryParts( size_t(SQLPartCount) ) @@ -245,7 +245,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc { Any aValue; Reference<XInterface> xDs = dbaccess::getDataSource(_xConnection); - if ( dbtools::getDataSourceSetting(xDs,static_cast <OUString> (PROPERTY_BOOLEANCOMPARISONMODE),aValue) ) + if ( dbtools::getDataSourceSetting(xDs,PROPERTY_BOOLEANCOMPARISONMODE,aValue) ) { OSL_VERIFY( aValue >>= m_nBoolCompareMode ); } @@ -474,7 +474,7 @@ OUString OSingleSelectQueryComposer::impl_getColumnRealName_throw(const Referenc { OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP)); SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() ); - throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,makeAny(aErr) ); + throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,Any(aErr) ); } OUString aName, aNewName; @@ -511,9 +511,9 @@ OUString OSingleSelectQueryComposer::impl_getColumnRealName_throw(const Referenc { if(sTableName.indexOf('.') != -1) { - OUString aCatlog,aSchema,aTable; - ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation); - sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation ); + OUString aCatalog,aSchema,aTable; + ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation); + sTableName = ::dbtools::composeTableName( m_xMetaData, aCatalog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation ); } else if (!sTableName.isEmpty()) sTableName = ::dbtools::quoteName(aQuote,sTableName); @@ -544,7 +544,7 @@ OUString OSingleSelectQueryComposer::impl_getColumnNameOrderBy_throw(const Refer { OUString sError(DBA_RES(RID_STR_COLUMN_UNKNOWN_PROP)); SQLException aErr(sError.replaceAll("%value", PROPERTY_NAME),*this,SQLSTATE_GENERAL,1000,Any() ); - throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,makeAny(aErr) ); + throw SQLException(DBA_RES(RID_STR_COLUMN_NOT_VALID),*this,SQLSTATE_GENERAL,1000,Any(aErr) ); } OUString aName; @@ -847,7 +847,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) { xStatement.reset( Reference< XStatement >( m_xConnection->createStatement(), UNO_SET_THROW ) ); Reference< XPropertySet > xStatementProps( xStatement, UNO_QUERY_THROW ); - try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, makeAny( false ) ); } + try { xStatementProps->setPropertyValue( PROPERTY_ESCAPE_PROCESSING, Any( false ) ); } catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION("dbaccess"); } xResMetaDataSup.set( xStatement->executeQuery( sSQL ), UNO_QUERY_THROW ); xResultSetMeta.set( xResMetaDataSup->getMetaData(), UNO_SET_THROW ); @@ -1524,9 +1524,9 @@ OUString OSingleSelectQueryComposer::getStatementPart( TGetParseNode const & _aG namespace { - OUString lcl_getDecomposedColumnName(const OUString& rComposedName, const OUString& rQuoteString) + OUString lcl_getDecomposedColumnName(const OUString& rComposedName, std::u16string_view rQuoteString) { - const sal_Int32 nQuoteLength = rQuoteString.getLength(); + const size_t nQuoteLength = rQuoteString.size(); OUString sName = rComposedName.trim(); OUString sColumnName; sal_Int32 nPos, nRPos = 0; @@ -1539,7 +1539,7 @@ namespace nRPos = sName.indexOf( rQuoteString, nPos + nQuoteLength ); if ( nRPos > nPos ) { - if ( nRPos + nQuoteLength < sName.getLength() ) + if ( static_cast<sal_Int32>(nRPos + nQuoteLength) < sName.getLength() ) { nRPos += nQuoteLength; // -1 + 1 skip dot } @@ -1561,7 +1561,7 @@ namespace OUString lcl_getCondition(const Sequence< Sequence< PropertyValue > >& filter, const OPredicateInputController& i_aPredicateInputController, const Reference< XNameAccess >& i_xSelectColumns, - const OUString& rQuoteString) + std::u16string_view rQuoteString) { OUStringBuffer sRet; const Sequence< PropertyValue >* pOrIter = filter.getConstArray(); @@ -1660,9 +1660,9 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert xColumn->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName; if(sTableName.indexOf('.') != -1) { - OUString aCatlog,aSchema,aTable; - ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatlog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation); - sTableName = ::dbtools::composeTableName( m_xMetaData, aCatlog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation ); + OUString aCatalog,aSchema,aTable; + ::dbtools::qualifiedNameComponents(m_xMetaData,sTableName,aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation); + sTableName = ::dbtools::composeTableName( m_xMetaData, aCatalog, aSchema, aTable, true, ::dbtools::EComposeRule::InDataManipulation ); } else sTableName = ::dbtools::quoteName(aQuote,sTableName); diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index 82948e6f1d4e..57eea66f34cf 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -23,17 +23,14 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <connectivity/CommonTools.hxx> #include <comphelper/types.hxx> +#include <o3tl/safeint.hxx> #include <osl/diagnose.h> using namespace dbaccess; using namespace connectivity; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; -using namespace ::osl; void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/) { @@ -43,7 +40,7 @@ void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/) // css::sdbcx::XRowLocate Any OStaticSet::getBookmark() { - return makeAny(getRow()); + return Any(getRow()); } bool OStaticSet::moveToBookmark( const Any& bookmark ) @@ -193,7 +190,7 @@ bool OStaticSet::absolute( sal_Int32 row ) } else if(row > 0) { - if(row >= static_cast<sal_Int32>(m_aSet.size())) + if(o3tl::make_unsigned(row) >= m_aSet.size()) { if(!m_bEnd) { @@ -202,7 +199,7 @@ bool OStaticSet::absolute( sal_Int32 row ) bNext = fetchRow(); } - if(row > static_cast<sal_Int32>(m_aSet.size())) + if(o3tl::make_unsigned(row) > m_aSet.size()) m_aSetIter = m_aSet.end(); // check again else m_aSetIter = m_aSet.begin() + row; diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index abd206b6e147..92821750f9dc 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -477,7 +477,7 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >& return nRet; } -Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelId() +const Sequence< sal_Int8 > & ODBTableDecorator::getUnoTunnelId() { static const comphelper::UnoIdInit implId; return implId.getSeq(); diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index c52c4885c757..ce813b29ee82 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace dbaccess { diff --git a/dbaccess/source/core/api/WrappedResultSet.cxx b/dbaccess/source/core/api/WrappedResultSet.cxx index b97fb4182d68..a4ad9f363cae 100644 --- a/dbaccess/source/core/api/WrappedResultSet.cxx +++ b/dbaccess/source/core/api/WrappedResultSet.cxx @@ -23,12 +23,8 @@ using namespace dbaccess; using namespace ::connectivity; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::lang; -using namespace ::osl; void WrappedResultSet::construct(const Reference< XResultSet>& _xDriverSet,const OUString& i_sRowSetFilter) { @@ -49,7 +45,7 @@ Any WrappedResultSet::getBookmark() { return m_xRowLocate->getBookmark( ); } - return makeAny(m_xDriverSet->getRow()); + return Any(m_xDriverSet->getRow()); } bool WrappedResultSet::moveToBookmark( const Any& bookmark ) diff --git a/dbaccess/source/core/api/callablestatement.cxx b/dbaccess/source/core/api/callablestatement.cxx index 8f864fbe04dd..25f3f405f8c1 100644 --- a/dbaccess/source/core/api/callablestatement.cxx +++ b/dbaccess/source/core/api/callablestatement.cxx @@ -24,10 +24,7 @@ using namespace dbaccess; using namespace ::com::sun::star::sdbc; -using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; using namespace ::cppu; using namespace ::osl; @@ -84,7 +81,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerOutParameter( parameterIndex, sqlType, typeName ); } @@ -92,7 +89,7 @@ void SAL_CALL OCallableStatement::registerOutParameter( sal_Int32 parameterIndex void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); Reference< XOutParameters >(m_xAggregateAsSet, UNO_QUERY_THROW)->registerNumericOutParameter( parameterIndex, sqlType, scale ); } @@ -101,7 +98,7 @@ void SAL_CALL OCallableStatement::registerNumericOutParameter( sal_Int32 paramet sal_Bool SAL_CALL OCallableStatement::wasNull( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->wasNull(); } @@ -109,7 +106,7 @@ sal_Bool SAL_CALL OCallableStatement::wasNull( ) OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getString( columnIndex ); } @@ -117,7 +114,7 @@ OUString SAL_CALL OCallableStatement::getString( sal_Int32 columnIndex ) sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBoolean( columnIndex ); } @@ -125,7 +122,7 @@ sal_Bool SAL_CALL OCallableStatement::getBoolean( sal_Int32 columnIndex ) sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getByte( columnIndex ); } @@ -133,63 +130,63 @@ sal_Int8 SAL_CALL OCallableStatement::getByte( sal_Int32 columnIndex ) sal_Int16 SAL_CALL OCallableStatement::getShort( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getShort( columnIndex ); } sal_Int32 SAL_CALL OCallableStatement::getInt( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getInt( columnIndex ); } sal_Int64 SAL_CALL OCallableStatement::getLong( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getLong( columnIndex ); } float SAL_CALL OCallableStatement::getFloat( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getFloat( columnIndex ); } double SAL_CALL OCallableStatement::getDouble( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDouble( columnIndex ); } Sequence< sal_Int8 > SAL_CALL OCallableStatement::getBytes( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBytes( columnIndex ); } css::util::Date SAL_CALL OCallableStatement::getDate( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getDate( columnIndex ); } css::util::Time SAL_CALL OCallableStatement::getTime( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTime( columnIndex ); } css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getTimestamp( columnIndex ); } @@ -197,7 +194,7 @@ css::util::DateTime SAL_CALL OCallableStatement::getTimestamp( sal_Int32 columnI Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBinaryStream( columnIndex ); } @@ -205,7 +202,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getBinaryStream( Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStream( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getCharacterStream( columnIndex ); } @@ -213,7 +210,7 @@ Reference< css::io::XInputStream > SAL_CALL OCallableStatement::getCharacterStre Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Reference< css::container::XNameAccess >& typeMap ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getObject( columnIndex, typeMap ); } @@ -221,28 +218,28 @@ Any SAL_CALL OCallableStatement::getObject( sal_Int32 columnIndex, const Referen Reference< XRef > SAL_CALL OCallableStatement::getRef( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getRef( columnIndex ); } Reference< XBlob > SAL_CALL OCallableStatement::getBlob( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getBlob( columnIndex ); } Reference< XClob > SAL_CALL OCallableStatement::getClob( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getClob( columnIndex ); } Reference< XArray > SAL_CALL OCallableStatement::getArray( sal_Int32 columnIndex ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XRow >(m_xAggregateAsSet, UNO_QUERY_THROW)->getArray( columnIndex ); } diff --git a/dbaccess/source/core/api/column.cxx b/dbaccess/source/core/api/column.cxx index 5bc70affbce0..ad205c3248fa 100644 --- a/dbaccess/source/core/api/column.cxx +++ b/dbaccess/source/core/api/column.cxx @@ -34,19 +34,16 @@ #include <connectivity/TTableHelper.hxx> #include <connectivity/dbexception.hxx> #include <cppuhelper/supportsservice.hxx> +#include <utility> #include <osl/diagnose.h> using namespace dbaccess; using namespace connectivity; -using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::awt; -using namespace ::com::sun::star::io; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::util; using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; @@ -147,7 +144,7 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, } OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, - const css::uno::Reference< css::container::XNameAccess >& _rxDrvColumns, + css::uno::Reference< css::container::XNameAccess > _xDrvColumns, bool _bCaseSensitive,const std::vector< OUString> &_rVector, IColumnFactory* _pColFactory, ::connectivity::sdbcx::IRefreshableColumns* _pRefresh, @@ -156,7 +153,7 @@ OColumns::OColumns(::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex, bool _bUseHardRef) : OColumns_BASE(_rParent,_bCaseSensitive,_rMutex,_rVector,_bUseHardRef) ,m_pMediator(nullptr) - ,m_xDrvColumns(_rxDrvColumns) + ,m_xDrvColumns(std::move(_xDrvColumns)) ,m_pColFactoryImpl(_pColFactory) ,m_pRefreshColumns(_pRefresh) ,m_bInitialized(false) diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx index 3f62a5a691fe..505e0d36b98f 100644 --- a/dbaccess/source/core/api/columnsettings.cxx +++ b/dbaccess/source/core/api/columnsettings.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include <comphelper/property.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> namespace dbaccess { @@ -121,14 +121,14 @@ namespace dbaccess }; const PropertyDescriptor aProps[] = { - { OUString(PROPERTY_ALIGN), PROPERTY_ID_ALIGN }, - { OUString(PROPERTY_NUMBERFORMAT), PROPERTY_ID_NUMBERFORMAT }, - { OUString(PROPERTY_RELATIVEPOSITION), PROPERTY_ID_RELATIVEPOSITION }, - { OUString(PROPERTY_WIDTH), PROPERTY_ID_WIDTH }, - { OUString(PROPERTY_HELPTEXT), PROPERTY_ID_HELPTEXT }, - { OUString(PROPERTY_CONTROLDEFAULT), PROPERTY_ID_CONTROLDEFAULT }, - { OUString(PROPERTY_CONTROLMODEL), PROPERTY_ID_CONTROLMODEL }, - { OUString(PROPERTY_HIDDEN), PROPERTY_ID_HIDDEN } + { PROPERTY_ALIGN, PROPERTY_ID_ALIGN }, + { PROPERTY_NUMBERFORMAT, PROPERTY_ID_NUMBERFORMAT }, + { PROPERTY_RELATIVEPOSITION, PROPERTY_ID_RELATIVEPOSITION }, + { PROPERTY_WIDTH, PROPERTY_ID_WIDTH }, + { PROPERTY_HELPTEXT, PROPERTY_ID_HELPTEXT }, + { PROPERTY_CONTROLDEFAULT, PROPERTY_ID_CONTROLDEFAULT }, + { PROPERTY_CONTROLMODEL, PROPERTY_ID_CONTROLMODEL }, + { PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN } }; for (const auto & aProp : aProps) diff --git a/dbaccess/source/core/api/datacolumn.cxx b/dbaccess/source/core/api/datacolumn.cxx index c597a40649bf..e0953449154a 100644 --- a/dbaccess/source/core/api/datacolumn.cxx +++ b/dbaccess/source/core/api/datacolumn.cxx @@ -25,12 +25,9 @@ using namespace dbaccess; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::osl; -using namespace ::comphelper; using namespace ::cppu; diff --git a/dbaccess/source/core/api/datasettings.cxx b/dbaccess/source/core/api/datasettings.cxx index e845f11350f8..f810f8669917 100644 --- a/dbaccess/source/core/api/datasettings.cxx +++ b/dbaccess/source/core/api/datasettings.cxx @@ -27,7 +27,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::awt; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::comphelper; using namespace ::cppu; diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index 3f95421803c1..b952edca2e7a 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -30,13 +30,13 @@ #include <comphelper/property.hxx> #include <connectivity/dbtools.hxx> #include <sal/log.hxx> -#include <tools/diagnose_ex.h> +#include <utility> +#include <comphelper/diagnose_ex.hxx> using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::container; using namespace ::cppu; using namespace ::comphelper; @@ -89,7 +89,7 @@ OUString OTableColumnDescriptor::getImplementationName( ) Sequence< OUString > OTableColumnDescriptor::getSupportedServiceNames( ) { - return { m_bActAsDescriptor? OUString(SERVICE_SDBCX_COLUMNDESCRIPTOR) : OUString(SERVICE_SDBCX_COLUMN), + return { m_bActAsDescriptor? SERVICE_SDBCX_COLUMNDESCRIPTOR : SERVICE_SDBCX_COLUMN, SERVICE_SDB_COLUMNSETTINGS }; } @@ -156,9 +156,9 @@ OUString OTableColumn::getImplementationName( ) // OQueryColumn -OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection, const OUString &i_sLabel ) +OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, const Reference< XConnection >& _rxConnection, OUString i_sLabel ) :OTableColumnDescriptor( false /* do not act as descriptor */ ) - ,m_sLabel(i_sLabel) + ,m_sLabel(std::move(i_sLabel)) { const sal_Int32 nPropAttr = PropertyAttribute::READONLY; registerProperty( PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, nPropAttr, &m_sCatalogName, cppu::UnoType<decltype(m_sCatalogName)>::get() ); @@ -169,35 +169,35 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co if( ! (_rxParserColumn->getPropertyValue( PROPERTY_TYPENAME ) >>= m_aTypeName) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_TYPENAME); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_TYPENAME); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISNULLABLE ) >>= m_nIsNullable) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISNULLABLE); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISNULLABLE); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_PRECISION ) >>= m_nPrecision) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_PRECISION); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_PRECISION); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_SCALE ) >>= m_nScale) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_SCALE); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_SCALE); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_TYPE ) >>= m_nType) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_TYPE); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_TYPE); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISAUTOINCREMENT ) >>= m_bAutoIncrement) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISAUTOINCREMENT); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISAUTOINCREMENT); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_ISCURRENCY ) >>= m_bCurrency) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_ISCURRENCY); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_ISCURRENCY); if( ! (_rxParserColumn->getPropertyValue( PROPERTY_NAME ) >>= m_sName) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_NAME); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_NAME); m_bRowVersion = false; Reference< XPropertySetInfo > xPSI( _rxParserColumn->getPropertySetInfo(), UNO_SET_THROW ); if ( xPSI->hasPropertyByName( PROPERTY_DEFAULTVALUE ) ) if( ! (_rxParserColumn->getPropertyValue( PROPERTY_DEFAULTVALUE ) >>= m_aDefaultValue) ) - SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " PROPERTY_DEFAULTVALUE); + SAL_WARN("dbaccess.core", "OQueryColumn: unable to get property " + PROPERTY_DEFAULTVALUE); // copy some optional properties from the parser column struct PropertyDescriptor @@ -207,10 +207,10 @@ OQueryColumn::OQueryColumn( const Reference< XPropertySet >& _rxParserColumn, co }; const PropertyDescriptor aProps[] = { - { OUString(PROPERTY_CATALOGNAME), PROPERTY_ID_CATALOGNAME }, - { OUString(PROPERTY_SCHEMANAME), PROPERTY_ID_SCHEMANAME }, - { OUString(PROPERTY_TABLENAME), PROPERTY_ID_TABLENAME }, - { OUString(PROPERTY_REALNAME), PROPERTY_ID_REALNAME } + { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME }, + { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME }, + { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME }, + { PROPERTY_REALNAME, PROPERTY_ID_REALNAME } }; for (const auto & aProp : aProps) { @@ -243,11 +243,11 @@ Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const // respective properties OUString sCatalog, sSchema, sTable; if( ! (getPropertyValue( PROPERTY_CATALOGNAME ) >>= sCatalog) ) - SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_CATALOGNAME); + SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_CATALOGNAME); if( ! (getPropertyValue( PROPERTY_SCHEMANAME ) >>= sSchema) ) - SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_SCHEMANAME); + SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_SCHEMANAME); if( ! (getPropertyValue( PROPERTY_TABLENAME ) >>= sTable) ) - SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_TABLENAME); + SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_TABLENAME); if ( sCatalog.isEmpty() && sSchema.isEmpty() && sTable.isEmpty() ) return nullptr; @@ -265,7 +265,7 @@ Reference< XPropertySet > OQueryColumn::impl_determineOriginalTableColumn( const OUString sColumn; if( ! (getPropertyValue( PROPERTY_REALNAME ) >>= sColumn) ) - SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " PROPERTY_REALNAME); + SAL_WARN("dbaccess.core", "impl_determineOriginalTableColumn: unable to get property " + PROPERTY_REALNAME); if ( !xColumns->hasByName( sColumn ) ) return nullptr; diff --git a/dbaccess/source/core/api/preparedstatement.cxx b/dbaccess/source/core/api/preparedstatement.cxx index 02dd32379a88..e7ec79a2ca87 100644 --- a/dbaccess/source/core/api/preparedstatement.cxx +++ b/dbaccess/source/core/api/preparedstatement.cxx @@ -31,11 +31,10 @@ #include <strings.hxx> #include "resultcolumn.hxx" #include "resultset.hxx" -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::cppu; @@ -117,7 +116,7 @@ sal_Bool OPreparedStatement::supportsService( const OUString& _rServiceName ) Sequence< OUString > OPreparedStatement::getSupportedServiceNames( ) { - return { SERVICE_SDBC_PREPAREDSTATEMENT, SERVICE_SDB_PREPAREDSTATMENT }; + return { SERVICE_SDBC_PREPAREDSTATEMENT, SERVICE_SDB_PREPAREDSTATEMENT }; } // OComponentHelper @@ -135,7 +134,7 @@ void OPreparedStatement::disposing() Reference< css::container::XNameAccess > OPreparedStatement::getColumns() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // do we have to populate the columns if (!m_pColumns->isInitialized()) @@ -175,7 +174,7 @@ Reference< css::container::XNameAccess > OPreparedStatement::getColumns() Reference< XResultSetMetaData > OPreparedStatement::getMetaData() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XResultSetMetaDataSupplier >( m_xAggregateAsSet, UNO_QUERY_THROW )->getMetaData(); } @@ -183,7 +182,7 @@ Reference< XResultSetMetaData > OPreparedStatement::getMetaData() Reference< XResultSet > OPreparedStatement::executeQuery() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); @@ -202,7 +201,7 @@ Reference< XResultSet > OPreparedStatement::executeQuery() sal_Int32 OPreparedStatement::executeUpdate() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); @@ -212,7 +211,7 @@ sal_Int32 OPreparedStatement::executeUpdate() sal_Bool OPreparedStatement::execute() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); @@ -228,7 +227,7 @@ Reference< XConnection > OPreparedStatement::getConnection() void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setNull(parameterIndex, sqlType); } @@ -236,7 +235,7 @@ void SAL_CALL OPreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 s void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setObjectNull(parameterIndex, sqlType, typeName); } @@ -244,7 +243,7 @@ void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 parameterIndex, sal_I void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setBoolean(parameterIndex, x); } @@ -252,7 +251,7 @@ void SAL_CALL OPreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setByte(parameterIndex, x); } @@ -260,7 +259,7 @@ void SAL_CALL OPreparedStatement::setByte( sal_Int32 parameterIndex, sal_Int8 x void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setShort(parameterIndex, x); } @@ -268,7 +267,7 @@ void SAL_CALL OPreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setInt(parameterIndex, x); } @@ -276,7 +275,7 @@ void SAL_CALL OPreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setLong(parameterIndex, x); } @@ -284,7 +283,7 @@ void SAL_CALL OPreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setFloat(parameterIndex, x); } @@ -292,7 +291,7 @@ void SAL_CALL OPreparedStatement::setFloat( sal_Int32 parameterIndex, float x ) void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setDouble(parameterIndex, x); } @@ -300,7 +299,7 @@ void SAL_CALL OPreparedStatement::setDouble( sal_Int32 parameterIndex, double x void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setString(parameterIndex, x); } @@ -308,7 +307,7 @@ void SAL_CALL OPreparedStatement::setString( sal_Int32 parameterIndex, const OUS void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setBytes(parameterIndex, x); } @@ -316,7 +315,7 @@ void SAL_CALL OPreparedStatement::setBytes( sal_Int32 parameterIndex, const Sequ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const css::util::Date& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setDate(parameterIndex, x); } @@ -324,7 +323,7 @@ void SAL_CALL OPreparedStatement::setDate( sal_Int32 parameterIndex, const css:: void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const css::util::Time& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setTime(parameterIndex, x); } @@ -332,7 +331,7 @@ void SAL_CALL OPreparedStatement::setTime( sal_Int32 parameterIndex, const css:: void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const css::util::DateTime& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setTimestamp(parameterIndex, x); } @@ -340,7 +339,7 @@ void SAL_CALL OPreparedStatement::setTimestamp( sal_Int32 parameterIndex, const void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setBinaryStream(parameterIndex, x, length); } @@ -348,7 +347,7 @@ void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 parameterIndex, con void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, const Reference< css::io::XInputStream >& x, sal_Int32 length ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setCharacterStream(parameterIndex, x, length); } @@ -356,7 +355,7 @@ void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 parameterIndex, void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setObject(parameterIndex, x); } @@ -364,7 +363,7 @@ void SAL_CALL OPreparedStatement::setObject( sal_Int32 parameterIndex, const Any void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, const Any& x, sal_Int32 targetSqlType, sal_Int32 scale ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setObjectWithInfo(parameterIndex, x, targetSqlType, scale); } @@ -372,7 +371,7 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( sal_Int32 parameterIndex, c void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Reference< XRef >& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setRef(parameterIndex, x); } @@ -380,7 +379,7 @@ void SAL_CALL OPreparedStatement::setRef( sal_Int32 parameterIndex, const Refere void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Reference< XBlob >& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setBlob(parameterIndex, x); } @@ -388,7 +387,7 @@ void SAL_CALL OPreparedStatement::setBlob( sal_Int32 parameterIndex, const Refer void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Reference< XClob >& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setClob(parameterIndex, x); } @@ -396,7 +395,7 @@ void SAL_CALL OPreparedStatement::setClob( sal_Int32 parameterIndex, const Refer void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Reference< XArray >& x ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->setArray(parameterIndex, x); } @@ -404,7 +403,7 @@ void SAL_CALL OPreparedStatement::setArray( sal_Int32 parameterIndex, const Refe void SAL_CALL OPreparedStatement::clearParameters( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); m_xAggregateAsParameters->clearParameters(); } diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 33ceca9ce2e4..c8e723853a7a 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -27,7 +27,7 @@ #include <strings.hrc> #include <strings.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <osl/diagnose.h> #include <com/sun/star/sdbc/XConnection.hpp> @@ -49,7 +49,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::util; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::comphelper; diff --git a/dbaccess/source/core/api/querycomposer.cxx b/dbaccess/source/core/api/querycomposer.cxx index 8bab8718709b..9c41f344ccf5 100644 --- a/dbaccess/source/core/api/querycomposer.cxx +++ b/dbaccess/source/core/api/querycomposer.cxx @@ -43,7 +43,6 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::cppu; using namespace ::osl; -using namespace ::utl; OQueryComposer::OQueryComposer(const Reference< XConnection>& _xConnection) diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 5a8a93a4f7d4..8e386dc411cd 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -44,7 +44,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; -using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; using namespace ::osl; @@ -196,7 +195,7 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet { m_eDoingCurrently = AggregateAction::Inserting; OAutoActionReset aAutoReset(*this); - m_xCommandDefinitions->insertByName(sNewObjectName, makeAny(xCommandDefinitionPart)); + m_xCommandDefinitions->insertByName(sNewObjectName, Any(xCommandDefinitionPart)); } implAppend( sNewObjectName, xNewObject ); @@ -261,7 +260,7 @@ void SAL_CALL OQueryContainer::elementInserted( const css::container::ContainerE // insert an own new element xNewElement = implCreateWrapper(sElementName); } - insertByName(sElementName,makeAny(xNewElement)); + insertByName(sElementName,Any(xNewElement)); } void SAL_CALL OQueryContainer::elementRemoved( const css::container::ContainerEvent& _rEvent ) @@ -293,7 +292,7 @@ void SAL_CALL OQueryContainer::elementReplaced( const css::container::ContainerE xNewElement = implCreateWrapper(sAccessor); } - replaceByName(sAccessor,makeAny(xNewElement)); + replaceByName(sAccessor,Any(xNewElement)); } Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const ContainerEvent& Event ) diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx index b9e7a0debca4..0aff2b0aaba1 100644 --- a/dbaccess/source/core/api/querydescriptor.cxx +++ b/dbaccess/source/core/api/querydescriptor.cxx @@ -25,11 +25,8 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::awt; -using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::util; using namespace ::osl; using namespace ::cppu; @@ -144,22 +141,6 @@ OQueryDescriptor_Base::~OQueryDescriptor_Base() m_pColumns->disposing(); } -sal_Int64 SAL_CALL OQueryDescriptor_Base::getSomething( const Sequence< sal_Int8 >& _rIdentifier ) -{ - return comphelper::getSomethingImpl(_rIdentifier, this); -} - -css::uno::Sequence<sal_Int8> OQueryDescriptor_Base::getUnoTunnelId() -{ - static const comphelper::UnoIdInit aId; - return aId.getSeq(); -} - -css::uno::Sequence<sal_Int8> OQueryDescriptor_Base::getImplementationId() -{ - return css::uno::Sequence<sal_Int8>(); -} - void OQueryDescriptor_Base::setColumnsOutOfDate( bool _bOutOfDate ) { m_bColumnsOutOfDate = _bOutOfDate; diff --git a/dbaccess/source/core/api/querydescriptor.hxx b/dbaccess/source/core/api/querydescriptor.hxx index e0930c8335a3..181b8e4d436d 100644 --- a/dbaccess/source/core/api/querydescriptor.hxx +++ b/dbaccess/source/core/api/querydescriptor.hxx @@ -19,13 +19,12 @@ #pragma once -#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase2.hxx> #include <comphelper/proparrhlp.hxx> #include <osl/mutex.hxx> #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> #include <apitools.hxx> #include <column.hxx> @@ -38,9 +37,8 @@ namespace dbaccess { // OQueryDescriptor_Base - a query descriptor (as the name suggests :) -typedef ::cppu::ImplHelper3< +typedef ::cppu::ImplHelper2< css::sdbcx::XColumnsSupplier, - css::lang::XUnoTunnel, css::lang::XServiceInfo > OQueryDescriptor_BASE; class OQueryDescriptor_Base @@ -75,12 +73,6 @@ public: // css::sdbcx::XColumnsSupplier virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getColumns( ) override; -// css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - virtual css::uno::Sequence<sal_Int8> SAL_CALL getImplementationId( ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - - // css::lang::XServiceInfo virtual OUString SAL_CALL getImplementationName( ) override; virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx index 4e467a305852..fbc8cb8a343f 100644 --- a/dbaccess/source/core/api/resultcolumn.cxx +++ b/dbaccess/source/core/api/resultcolumn.cxx @@ -23,15 +23,13 @@ #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/ColumnValue.hpp> #include <com/sun/star/sdbc/XRow.hpp> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <stringconstants.hxx> #include <strings.hxx> using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::container; using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; @@ -68,7 +66,7 @@ void OResultColumn::impl_determineIsRowVersion_nothrow() try { Reference< XResultSet > xVersionColumns = m_xDBMetaData->getVersionColumns( - makeAny( sCatalog ), sSchema, sTable ); + Any( sCatalog ), sSchema, sTable ); if ( xVersionColumns.is() ) // allowed to be NULL { Reference< XRow > xResultRow( xVersionColumns, UNO_QUERY_THROW ); @@ -125,32 +123,32 @@ void OResultColumn::disposing() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OResultColumn::createArrayHelper( ) const { - css::uno::Sequence< css::beans::Property> aDescriptor(21); - css::beans::Property* pDesc = aDescriptor.getArray(); - sal_Int32 nPos = 0; - pDesc[nPos++] = css::beans::Property(PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); - return new ::cppu::OPropertyArrayHelper(aDescriptor); + return new ::cppu::OPropertyArrayHelper + { + { + { PROPERTY_CATALOGNAME, PROPERTY_ID_CATALOGNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_DISPLAYSIZE, PROPERTY_ID_DISPLAYSIZE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISAUTOINCREMENT, PROPERTY_ID_ISAUTOINCREMENT, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCASESENSITIVE, PROPERTY_ID_ISCASESENSITIVE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISCURRENCY, PROPERTY_ID_ISCURRENCY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISDEFINITELYWRITABLE, PROPERTY_ID_ISDEFINITELYWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISNULLABLE, PROPERTY_ID_ISNULLABLE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISREADONLY, PROPERTY_ID_ISREADONLY, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISROWVERSION, PROPERTY_ID_ISROWVERSION, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSEARCHABLE, PROPERTY_ID_ISSEARCHABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISSIGNED, PROPERTY_ID_ISSIGNED, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_ISWRITABLE, PROPERTY_ID_ISWRITABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_PRECISION, PROPERTY_ID_PRECISION, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCALE, PROPERTY_ID_SCALE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SCHEMANAME, PROPERTY_ID_SCHEMANAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_SERVICENAME, PROPERTY_ID_SERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TABLENAME, PROPERTY_ID_TABLENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPE, PROPERTY_ID_TYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_TYPENAME, PROPERTY_ID_TYPENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY } + } + }; } // cppu::OPropertySetHelper diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index dd5833fcd523..cc6a6fe018f4 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -28,7 +28,7 @@ #include <cppuhelper/queryinterface.hxx> #include <cppuhelper/typeprovider.hxx> #include <comphelper/types.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include "datacolumn.hxx" #include <connectivity/dbexception.hxx> #include <connectivity/dbtools.hxx> @@ -186,17 +186,17 @@ Reference< XPropertySetInfo > OResultSet::getPropertySetInfo() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OResultSet::createArrayHelper( ) const { - css::uno::Sequence< css::beans::Property> aDescriptor(6); - css::beans::Property* pDesc = aDescriptor.getArray(); - sal_Int32 nPos = 0; - pDesc[nPos++] = css::beans::Property(PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - pDesc[nPos++] = css::beans::Property(PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY); - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); - return new ::cppu::OPropertyArrayHelper(aDescriptor); + return new ::cppu::OPropertyArrayHelper + { + { + { PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_ISBOOKMARKABLE, PROPERTY_ID_ISBOOKMARKABLE, cppu::UnoType<bool>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY }, + { PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), css::beans::PropertyAttribute::READONLY } + } + }; } // cppu::OPropertySetHelper diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index 290eac540099..1a20823ab9dd 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -29,7 +29,7 @@ #include <cppuhelper/typeprovider.hxx> #include <comphelper/property.hxx> #include <comphelper/types.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> #include <connectivity/dbexception.hxx> using namespace ::com::sun::star::sdb; @@ -46,7 +46,7 @@ using namespace dbtools; OStatementBase::OStatementBase(const Reference< XConnection > & _xConn, const Reference< XInterface > & _xStatement) :OSubComponent(m_aMutex, _xConn) - ,OPropertySetHelper(OComponentHelper::rBHelper) + ,OPropertySetHelper(WeakComponentImplHelper::rBHelper) ,m_bUseBookmarks( false ) ,m_bEscapeProcessing( true ) @@ -124,7 +124,7 @@ void OStatementBase::disposeResultSet() Reference< XComponent > xComp(m_aResultSet.get(), UNO_QUERY); if (xComp.is()) xComp->dispose(); - m_aResultSet = nullptr; + m_aResultSet.clear(); } // OComponentHelper @@ -164,7 +164,7 @@ void OStatementBase::close() { { MutexGuard aGuard( m_aMutex ); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); } dispose(); } @@ -178,21 +178,21 @@ Reference< XPropertySetInfo > OStatementBase::getPropertySetInfo() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* OStatementBase::createArrayHelper( ) const { - css::uno::Sequence< css::beans::Property> aDescriptor(10); - css::beans::Property* pDesc = aDescriptor.getArray(); - sal_Int32 nPos = 0; - pDesc[nPos++] = css::beans::Property(PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, cppu::UnoType<bool>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_MAXFIELDSIZE, PROPERTY_ID_MAXFIELDSIZE, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_MAXROWS, PROPERTY_ID_MAXROWS, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_QUERYTIMEOUT, PROPERTY_ID_QUERYTIMEOUT, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), 0); - pDesc[nPos++] = css::beans::Property(PROPERTY_USEBOOKMARKS, PROPERTY_ID_USEBOOKMARKS, cppu::UnoType<bool>::get(), 0); - OSL_ENSURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); - return new ::cppu::OPropertyArrayHelper(aDescriptor); + return new ::cppu::OPropertyArrayHelper + { + { + { PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, cppu::UnoType<OUString>::get(), 0 }, + { PROPERTY_ESCAPE_PROCESSING, PROPERTY_ID_ESCAPE_PROCESSING, cppu::UnoType<bool>::get(), 0 }, + { PROPERTY_FETCHDIRECTION, PROPERTY_ID_FETCHDIRECTION, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_FETCHSIZE, PROPERTY_ID_FETCHSIZE, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_MAXFIELDSIZE, PROPERTY_ID_MAXFIELDSIZE, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_MAXROWS, PROPERTY_ID_MAXROWS, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_QUERYTIMEOUT, PROPERTY_ID_QUERYTIMEOUT, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, cppu::UnoType<sal_Int32>::get(), 0 }, + { PROPERTY_USEBOOKMARKS, PROPERTY_ID_USEBOOKMARKS, cppu::UnoType<bool>::get(), 0 } + } + }; } // cppu::OPropertySetHelper @@ -293,7 +293,7 @@ void OStatementBase::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) cons Any OStatementBase::getWarnings() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); return Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->getWarnings(); } @@ -301,7 +301,7 @@ Any OStatementBase::getWarnings() void OStatementBase::clearWarnings() { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); Reference< XWarningsSupplier >(m_xAggregateAsSet, UNO_QUERY_THROW)->clearWarnings(); } @@ -320,7 +320,7 @@ void OStatementBase::cancel() Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -333,7 +333,7 @@ Reference< XResultSet > SAL_CALL OStatementBase::getResultSet( ) sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -346,7 +346,7 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount( ) sal_Bool SAL_CALL OStatementBase::getMoreResults( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -363,7 +363,7 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults( ) void SAL_CALL OStatementBase::addBatch( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -376,7 +376,7 @@ void SAL_CALL OStatementBase::addBatch( ) void SAL_CALL OStatementBase::clearBatch( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -389,7 +389,7 @@ void SAL_CALL OStatementBase::clearBatch( ) Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -405,7 +405,7 @@ Sequence< sal_Int32 > SAL_CALL OStatementBase::executeBatch( ) Reference< XResultSet > SAL_CALL OStatementBase::getGeneratedValues( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); Reference< XGeneratedResultSet > xGRes(m_xAggregateAsSet, UNO_QUERY); if ( xGRes.is() ) @@ -446,7 +446,7 @@ Sequence< OUString > OStatement::getSupportedServiceNames( ) Reference< XResultSet > OStatement::executeQuery( const OUString& _rSQL ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); Reference< XResultSet > xResultSet; @@ -472,7 +472,7 @@ Reference< XResultSet > OStatement::executeQuery( const OUString& _rSQL ) sal_Int32 OStatement::executeUpdate( const OUString& _rSQL ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); @@ -483,7 +483,7 @@ sal_Int32 OStatement::executeUpdate( const OUString& _rSQL ) sal_Bool OStatement::execute( const OUString& _rSQL ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); disposeResultSet(); @@ -494,7 +494,7 @@ sal_Bool OStatement::execute( const OUString& _rSQL ) void OStatement::addBatch( const OUString& _rSQL ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); @@ -508,7 +508,7 @@ void OStatement::addBatch( const OUString& _rSQL ) void OStatement::clearBatch( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) @@ -520,7 +520,7 @@ void OStatement::clearBatch( ) Sequence< sal_Int32 > OStatement::executeBatch( ) { MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed); + ::connectivity::checkDisposed(WeakComponentImplHelper::rBHelper.bDisposed); // first check the meta data Reference<XDatabaseMetaData> xMeta = Reference< XConnection > (m_xParent, UNO_QUERY_THROW)->getMetaData(); if (!xMeta.is() || !xMeta->supportsBatchUpdates()) diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx index 50467cfa0c2e..bb2a6f832dea 100644 --- a/dbaccess/source/core/api/table.cxx +++ b/dbaccess/source/core/api/table.cxx @@ -40,7 +40,6 @@ using namespace dbaccess; using namespace connectivity; using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::util; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; @@ -309,18 +308,6 @@ void SAL_CALL ODBTable::alterColumnByName( const OUString& _rName, const Referen m_xColumns->refresh(); } -sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<OTable_Base>{}); -} - -Sequence< sal_Int8 > ODBTable::getUnoTunnelId() -{ - static const comphelper::UnoIdInit s_Id; - return s_Id.getSeq(); -} - Reference< XPropertySet > ODBTable::createColumnDescriptor() { return new OTableColumnDescriptor( true ); diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 27f40f97f964..1a7e2a261609 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -40,7 +40,7 @@ #include <sdbcoretools.hxx> #include <ContainerMediator.hxx> #include <objectnameapproval.hxx> -#include <tools/diagnose_ex.h> +#include <comphelper/diagnose_ex.hxx> using namespace dbaccess; using namespace dbtools; @@ -51,7 +51,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; -using namespace ::com::sun::star::util; using namespace ::osl; using namespace ::comphelper; using namespace ::cppu; @@ -156,7 +155,7 @@ void lcl_createDefinitionObject(const OUString& _rName { // set as folder _xTableDefinition = TableDefinition::createWithName( ::comphelper::getProcessComponentContext(), _rName ); - _xTableDefinitions->insertByName(_rName,makeAny(_xTableDefinition)); + _xTableDefinitions->insertByName(_rName,Any(_xTableDefinition)); } Reference<XColumnsSupplier> xColumnsSupplier(_xTableDefinition,UNO_QUERY); if ( xColumnsSupplier.is() ) @@ -408,7 +407,7 @@ void SAL_CALL OTableContainer::elementInserted( const ContainerEvent& Event ) ObjectType xName = createObject(sName); insertElement(sName,xName); // and notify our listeners - ContainerEvent aEvent(static_cast<XContainer*>(this), makeAny(sName), makeAny(xName), Any()); + ContainerEvent aEvent(static_cast<XContainer*>(this), Any(sName), Any(xName), Any()); m_aContainerListeners.notifyEach( &XContainerListener::elementInserted, aEvent ); } } diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 462a3b1d0004..7e170b86d43a 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -34,9 +34,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; -using namespace ::com::sun::star::util; using namespace ::com::sun::star::container; using namespace ::osl; using namespace ::comphelper; |