diff options
Diffstat (limited to 'dbaccess/source/core/api/FilteredContainer.cxx')
-rw-r--r-- | dbaccess/source/core/api/FilteredContainer.cxx | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 2e383596f12f..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 @@ -326,8 +322,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: return; } } - aTableTypeFilter.realloc( 1 ); - aTableTypeFilter[0] = sInherentTableTypeRestriction; + aTableTypeFilter = { sInherentTableTypeRestriction }; } else { @@ -342,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 ); @@ -431,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 ) { @@ -441,19 +436,13 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std:: SAL_WARN("dbaccess", "OTableContainer::getAllTableTypeFilter: unknown TableTypeFilterMode!" ); [[fallthrough]]; case FILTER_MODE_MIX_ALL: - _rFilter.realloc( 3 ); - _rFilter[0] = sView; - _rFilter[1] = sTable; - _rFilter[2] = sAll; + _rFilter = { sView, sTable, sAll }; break; case FILTER_MODE_FIXED: - _rFilter.realloc( 2 ); - _rFilter[0] = sView; - _rFilter[1] = sTable; + _rFilter = { sView, sTable }; break; case FILTER_MODE_WILDCARD: - _rFilter.realloc( 1 ); - _rFilter[0] = sAll; + _rFilter = { sAll }; break; case FILTER_MODE_STANDARD: _rFilter.realloc( 0 ); |