summaryrefslogtreecommitdiff
path: root/dbaccess/source
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 21:20:18 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-05 19:24:57 +0200
commit2ed3d691b42525f6c1cc430d5863febcb102816e (patch)
tree97088acb96f8ad26f2ae67f3f8e5c2f6aab05cf0 /dbaccess/source
parent6c31c2b01dd32cc7ba1230f2c4a98b8f7def219b (diff)
Use hasElements to check Sequence emptiness in cppcanvas..desktop
Similar to clang-tidy readability-container-size-empty Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162 Reviewed-on: https://gerrit.libreoffice.org/71799 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess/source')
-rw-r--r--dbaccess/source/core/api/FilteredContainer.cxx4
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx2
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/ContentHelper.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/documentcontainer.cxx6
-rw-r--r--dbaccess/source/core/dataaccess/documentdefinition.cxx14
-rw-r--r--dbaccess/source/core/dataaccess/documentevents.cxx2
-rw-r--r--dbaccess/source/core/misc/DatabaseDataProvider.cxx6
-rw-r--r--dbaccess/source/filter/xml/xmlDataSourceSetting.cxx2
-rw-r--r--dbaccess/source/filter/xml/xmlExport.cxx10
-rw-r--r--dbaccess/source/filter/xml/xmlfilter.cxx2
-rw-r--r--dbaccess/source/ui/app/AppController.cxx6
-rw-r--r--dbaccess/source/ui/browser/exsrcbrw.cxx2
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx2
-rw-r--r--dbaccess/source/ui/dlg/tablespage.cxx2
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx2
-rw-r--r--dbaccess/source/ui/misc/RowSetDrop.cxx2
-rw-r--r--dbaccess/source/ui/misc/TokenWriter.cxx8
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
-rw-r--r--dbaccess/source/ui/misc/linkeddocuments.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx6
-rw-r--r--dbaccess/source/ui/relationdesign/RTableConnectionData.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx2
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx6
26 files changed, 51 insertions, 51 deletions
diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx
index a24cbc0c740a..c69cc4158a14 100644
--- a/dbaccess/source/core/api/FilteredContainer.cxx
+++ b/dbaccess/source/core/api/FilteredContainer.cxx
@@ -306,7 +306,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
OUString sInherentTableTypeRestriction( getTableTypeRestriction() );
if ( !sInherentTableTypeRestriction.isEmpty() )
{
- if ( _rTableTypeFilter.getLength() != 0 )
+ if ( _rTableTypeFilter.hasElements() )
{
const OUString* tableType = _rTableTypeFilter.getConstArray();
const OUString* tableTypeEnd = tableType + _rTableTypeFilter.getLength();
@@ -328,7 +328,7 @@ static sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, std::
else
{
// no container-inherent restriction for the table types
- if ( _rTableTypeFilter.getLength() == 0 )
+ if ( !_rTableTypeFilter.hasElements() )
{ // no externally-provided table type filter => use the default filter
getAllTableTypeFilter( aTableTypeFilter );
}
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 544d9269bcd8..ee4491d52606 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -191,7 +191,7 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
{
if(!_rUpdateTableName.isEmpty() && xTables->hasByName(_rUpdateTableName))
xTables->getByName(_rUpdateTableName) >>= m_aUpdateTable;
- else if(xTables->getElementNames().getLength())
+ else if(xTables->getElementNames().hasElements())
{
aUpdateTableName = xTables->getElementNames()[0];
xTables->getByName(aUpdateTableName) >>= m_aUpdateTable;
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index c5cd28e606e4..319b95b982b3 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1531,7 +1531,7 @@ namespace
const Sequence< PropertyValue >* pOrEnd = pOrIter + filter.getLength();
while ( pOrIter != pOrEnd )
{
- if ( pOrIter->getLength() )
+ if ( pOrIter->hasElements() )
{
sRet.append(L_BRACKET);
const PropertyValue* pAndIter = pOrIter->getConstArray();
diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index 9e462e97116f..479bcddaa38c 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -198,7 +198,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma
// Unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
OSL_FAIL( "No properties!" );
ucbhelper::cancelCommandExecution(
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 0e1e4bfa9285..6931feb3123d 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -611,7 +611,7 @@ sal_Bool ODatabaseContext::hasElements()
MutexGuard aGuard(m_aMutex);
::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed);
- return 0 != getElementNames().getLength();
+ return getElementNames().hasElements();
}
// css::container::XEnumerationAccess
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index 992eb24e5759..9e9a1f8918ea 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -213,7 +213,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
if ( xElements.is() )
sPersistentName = ::dbtools::createUniqueName(xElements,sPersistentName);
- const bool bNeedClassID = (0 == aClassID.getLength()) && sURL.isEmpty() ;
+ const bool bNeedClassID = !aClassID.hasElements() && sURL.isEmpty() ;
if ( xCopyFrom.is() )
{
Sequence<Any> aIni(2);
@@ -265,13 +265,13 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments
pElementImpl = aFind->second;
::rtl::Reference< ODocumentDefinition > pDocDef = new ODocumentDefinition( *this, m_aContext, pElementImpl, m_bFormsContainer );
- if ( aClassID.getLength() )
+ if ( aClassID.hasElements() )
{
pDocDef->initialLoad( aClassID, aCreationArgs, xConnection );
}
else
{
- OSL_ENSURE( aCreationArgs.getLength() == 0, "ODocumentContainer::createInstance: additional creation args are lost, if you do not provide a class ID." );
+ OSL_ENSURE( !aCreationArgs.hasElements(), "ODocumentContainer::createInstance: additional creation args are lost, if you do not provide a class ID." );
}
xContent = pDocDef.get();
diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx
index abe4570fd719..1d68932a42b1 100644
--- a/dbaccess/source/core/dataaccess/documentdefinition.cxx
+++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx
@@ -354,7 +354,7 @@ OUString ODocumentDefinition::GetDocumentServiceFromMediaType( const OUString& _
::comphelper::MimeConfigurationHelper aConfigHelper( _rContext );
sResult = aConfigHelper.GetDocServiceNameFromMediaType( _rMediaType );
_rClassId = comphelper::MimeConfigurationHelper::GetSequenceClassIDRepresentation(aConfigHelper.GetExplicitlyRegisteredObjClassID( _rMediaType ));
- if ( !_rClassId.getLength() && !sResult.isEmpty() )
+ if ( !_rClassId.hasElements() && !sResult.isEmpty() )
{
Reference< XNameAccess > xObjConfig = aConfigHelper.GetObjConfiguration();
if ( xObjConfig.is() )
@@ -409,8 +409,8 @@ ODocumentDefinition::ODocumentDefinition( const Reference< XInterface >& _rxCont
void ODocumentDefinition::initialLoad( const Sequence< sal_Int8 >& i_rClassID, const Sequence< PropertyValue >& i_rCreationArgs,
const Reference< XConnection >& i_rConnection )
{
- OSL_ENSURE( i_rClassID.getLength(), "ODocumentDefinition::initialLoad: illegal class ID!" );
- if ( !i_rClassID.getLength() )
+ OSL_ENSURE( i_rClassID.hasElements(), "ODocumentDefinition::initialLoad: illegal class ID!" );
+ if ( !i_rClassID.hasElements() )
return;
loadEmbeddedObject( i_rConnection, i_rClassID, i_rCreationArgs, false, false );
@@ -1028,7 +1028,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
{
Sequence<Any> aIni;
aCommand.Argument >>= aIni;
- if ( !aIni.getLength() )
+ if ( !aIni.hasElements() )
{
OSL_FAIL( "Wrong argument count!" );
ucbhelper::cancelCommandExecution(
@@ -1543,7 +1543,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
bool bSetSize = false;
sal_Int32 nEntryConnectionMode = EntryInitModes::DEFAULT_INIT;
Sequence< sal_Int8 > aClassID = _aClassID;
- if ( aClassID.getLength() )
+ if ( aClassID.hasElements() )
{
nEntryConnectionMode = EntryInitModes::TRUNCATE_INIT;
bSetSize = true;
@@ -1566,7 +1566,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
throw aWFE;
}
}
- if ( !aClassID.getLength() )
+ if ( !aClassID.hasElements() )
{
if ( m_bForm )
aClassID = MimeConfigurationHelper::GetSequenceClassID(SO3_SW_CLASSID);
@@ -1577,7 +1577,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_
}
}
- OSL_ENSURE( aClassID.getLength(),"No Class ID" );
+ OSL_ENSURE( aClassID.hasElements(),"No Class ID" );
Sequence< PropertyValue > aEmbeddedObjectDescriptor;
Sequence< PropertyValue > aLoadArgs( fillLoadArgs(
diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx
index d2c87a414a87..418d466ad816 100644
--- a/dbaccess/source/core/dataaccess/documentevents.cxx
+++ b/dbaccess/source/core/dataaccess/documentevents.cxx
@@ -184,7 +184,7 @@ namespace dbaccess
Any aReturn;
const Sequence< PropertyValue >& rEventDesc( elementPos->second );
- if ( rEventDesc.getLength() > 0 )
+ if ( rEventDesc.hasElements() )
aReturn <<= rEventDesc;
return aReturn;
}
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index 9f4517bb066b..0cddb3301714 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -662,7 +662,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
typedef std::vector< ColumnDescription > ColumnDescriptions;
ColumnDescriptions aColumns;
bool bFirstColumnIsCategory = _bHasCategories;
- if ( i_aColumnNames.getLength() )
+ if ( i_aColumnNames.hasElements() )
{
// some normalizations ...
uno::Sequence< OUString > aImposedColumnNames( i_aColumnNames );
@@ -683,7 +683,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
// column. This, this results in a ColumnDescriptions array like <"", "col2", "col3">, where you'd expect
// <"col1", "col2", "col3">.
// Fix this with some heuristics:
- if ( ( aImposedColumnNames.getLength() > 0 ) && ( !aImposedColumnNames[0].isEmpty() ) )
+ if ( aImposedColumnNames.hasElements() && ( !aImposedColumnNames[0].isEmpty() ) )
{
const sal_Int32 nAssumedRowSetColumnIndex = _bHasCategories ? 1 : 0;
if ( nAssumedRowSetColumnIndex < aRowSetColumnNames.getLength() )
@@ -699,7 +699,7 @@ void DatabaseDataProvider::impl_fillInternalDataProvider_throw(bool _bHasCategor
if ( _bHasCategories && aColumns.empty() )
{
- if ( aRowSetColumnNames.getLength() )
+ if ( aRowSetColumnNames.hasElements() )
aColumns.emplace_back( aRowSetColumnNames[0] );
else
aColumns.emplace_back( sColumnName );
diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
index 7d928d140949..74d0e9b992b9 100644
--- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
+++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx
@@ -133,7 +133,7 @@ void OXMLDataSourceSetting::EndElement()
{
if ( !m_aSetting.Name.isEmpty() )
{
- if ( m_bIsList && m_aInfoSequence.getLength() )
+ if ( m_bIsList && m_aInfoSequence.hasElements() )
m_aSetting.Value <<= m_aInfoSequence;
// if our property is of type string, but was empty, ensure that
diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx
index fafb22960aee..3d54d0a57b27 100644
--- a/dbaccess/source/filter/xml/xmlExport.cxx
+++ b/dbaccess/source/filter/xml/xmlExport.cxx
@@ -517,14 +517,14 @@ void ODBExport::exportApplicationConnectionSettings(const TSettingsMap& _aSettin
Reference<XPropertySet> xProp(getDataSource());
Sequence< OUString> aValue;
xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= aValue;
- if ( aValue.getLength() )
+ if ( aValue.hasElements() )
{
SvXMLElementExport aElem2(*this,XML_NAMESPACE_DB, XML_TABLE_FILTER, true, true);
exportSequence(aValue,XML_TABLE_INCLUDE_FILTER,XML_TABLE_FILTER_PATTERN);
}
xProp->getPropertyValue(PROPERTY_TABLETYPEFILTER) >>= aValue;
- if ( aValue.getLength() )
+ if ( aValue.hasElements() )
exportSequence(aValue,XML_TABLE_TYPE_FILTER,XML_TABLE_TYPE);
exportDataSourceSettings();
@@ -687,7 +687,7 @@ void ODBExport::exportDataSourceSettings()
{
Sequence<Any> aSeq;
aIter->Value >>= aSeq;
- if ( aSeq.getLength() )
+ if ( aSeq.hasElements() )
sTypeName = lcl_implGetPropertyXMLType(aSeq[0].getValueType());
}
@@ -773,7 +773,7 @@ void ODBExport::exportSequence(const Sequence< OUString>& _aValue
,::xmloff::token::XMLTokenEnum _eTokenType)
{
Reference<XPropertySet> xProp(getDataSource());
- if ( _aValue.getLength() )
+ if ( _aValue.hasElements() )
{
SvXMLElementExport aElem(*this,XML_NAMESPACE_DB, _eTokenFilter, true, true);
@@ -1295,7 +1295,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps)
Any aValue = xProp->getPropertyValue(PROPERTY_LAYOUTINFORMATION);
Sequence< PropertyValue > aPropValues;
aValue >>= aPropValues;
- if ( aPropValues.getLength() )
+ if ( aPropValues.hasElements() )
{
aProps.realloc(nLength + 1);
aProps[nLength].Name = "layout-settings";
diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 9dbb729f7d47..27bc17bd762d 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -946,7 +946,7 @@ void ODBFilter::setPropertyInfo()
aDataSourceSettings.merge( ::comphelper::NamedValueCollection( aInfo ), true );
aDataSourceSettings >>= aInfo;
- if ( aInfo.getLength() )
+ if ( aInfo.hasElements() )
{
try
{
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index f36f9b2e860d..dde699a8cfc0 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -1038,7 +1038,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa
break;
case SID_DB_APP_PASTE_SPECIAL:
{
- if ( !aArgs.getLength() )
+ if ( !aArgs.hasElements() )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(getFrameWeld()));
@@ -2690,7 +2690,7 @@ sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection )
// BEGIN compatibility
Sequence< NamedValue > aCurrentSelection;
- if ( (_aSelection >>= aCurrentSelection) && aCurrentSelection.getLength() )
+ if ( (_aSelection >>= aCurrentSelection) && aCurrentSelection.hasElements() )
{
ElementType eType = E_NONE;
const NamedValue* pIter = aCurrentSelection.getConstArray();
@@ -2803,7 +2803,7 @@ Any SAL_CALL OApplicationController::getSelection( )
if ( eType != E_NONE )
{
getContainer()->describeCurrentSelectionForType( eType, aCurrentSelection );
- if ( aCurrentSelection.getLength() == 0 )
+ if ( !aCurrentSelection.hasElements() )
{ // if no objects are selected, add an entry to the sequence which describes the overall category
// which is selected currently
aCurrentSelection.realloc(1);
diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx
index 64758528784b..3dba644889f9 100644
--- a/dbaccess/source/ui/browser/exsrcbrw.cxx
+++ b/dbaccess/source/ui/browser/exsrcbrw.cxx
@@ -171,7 +171,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const css::util::URL& aURL, con
SAL_WARN("dbaccess.ui", "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !");
sControlType = "TextField";
}
- OSL_ENSURE(aControlProps.getLength(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !");
+ OSL_ENSURE(aControlProps.hasElements(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !");
// create the col
Reference< css::form::XGridColumnFactory > xColFactory(getControlModel(), UNO_QUERY);
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index ec92901a2ab7..6bdb682f32d7 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1951,7 +1951,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
aDescriptor[DataAccessDescriptorProperty::CommandType] = xProp->getPropertyValue(PROPERTY_COMMAND_TYPE);
aDescriptor[DataAccessDescriptorProperty::Connection] = xProp->getPropertyValue(PROPERTY_ACTIVE_CONNECTION);
aDescriptor[DataAccessDescriptorProperty::Cursor] <<= xCursorClone;
- if ( aSelection.getLength() )
+ if ( aSelection.hasElements() )
{
aDescriptor[DataAccessDescriptorProperty::Selection] <<= aSelection;
aDescriptor[DataAccessDescriptorProperty::BookmarkSelection] <<= false;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index d80dbbd344b6..1f86ff57d645 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -772,7 +772,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
Sequence< Any> aTypeSettings;
aTypeSettings = aProperties.getOrDefault("TypeInfoSettings",aTypeSettings);
// here we have a special entry for types from oracle
- if ( aTypeSettings.getLength() )
+ if ( aTypeSettings.hasElements() )
{
aRelevantSettings.insert(PropertyValue("TypeInfoSettings", 0, makeAny(aTypeSettings), PropertyState_DIRECT_VALUE));
}
diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx
index 7c13312c963e..0e6c78bf1e1a 100644
--- a/dbaccess/source/ui/dlg/tablespage.cxx
+++ b/dbaccess/source/ui/dlg/tablespage.cxx
@@ -167,7 +167,7 @@ namespace dbaui
void OTableSubscriptionPage::implCompleteTablesCheck( const css::uno::Sequence< OUString >& _rTableFilter )
{
- if (!_rTableFilter.getLength())
+ if (!_rTableFilter.hasElements())
{ // no tables visible
CheckAll(false);
}
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 1d34c41f0ddb..eea6882135ef 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -815,7 +815,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
// create sql string and set column types
Sequence< OUString> aDestColumnNames = xDestColsSup->getColumns()->getElementNames();
- if ( aDestColumnNames.getLength() == 0 )
+ if ( !aDestColumnNames.hasElements() )
{
return Reference< XPreparedStatement > ();
}
diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx
index 99d0d7a622b4..c402ff3e9f4a 100644
--- a/dbaccess/source/ui/misc/RowSetDrop.cxx
+++ b/dbaccess/source/ui/misc/RowSetDrop.cxx
@@ -105,7 +105,7 @@ bool ORowSetImportExport::Read()
[](sal_Int32 n) { return n > 0; }))
return false;
bool bContinue = true;
- if(m_aSelection.getLength())
+ if(m_aSelection.hasElements())
{
const Any* pBegin = m_aSelection.getConstArray();
const Any* pEnd = pBegin + m_aSelection.getLength();
diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx
index c862af65969a..935e18bfd3fd 100644
--- a/dbaccess/source/ui/misc/TokenWriter.cxx
+++ b/dbaccess/source/ui/misc/TokenWriter.cxx
@@ -183,7 +183,7 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
m_xRowLocate.set( m_xResultSet, UNO_QUERY );
}
- if ( m_aSelection.getLength() != 0 )
+ if ( m_aSelection.hasElements() )
{
if ( !m_xResultSet.is() )
{
@@ -192,7 +192,7 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
}
}
- if ( m_aSelection.getLength() != 0 )
+ if ( m_aSelection.hasElements() )
{
if ( m_bBookmarkSelection && !m_xRowLocate.is() )
{
@@ -451,7 +451,7 @@ bool ORTFImportExport::Write()
sal_Int32 k=1;
sal_Int32 kk=0;
- if ( m_aSelection.getLength() )
+ if ( m_aSelection.hasElements() )
{
const Any* pSelIter = m_aSelection.getConstArray();
const Any* pEnd = pSelIter + m_aSelection.getLength();
@@ -699,7 +699,7 @@ void OHTMLImportExport::WriteTables()
Reference<XColumnsSupplier> xColSup(m_xObject,UNO_QUERY);
xColumns = xColSup->getColumns();
aNames = xColumns->getElementNames();
- if ( !aNames.getLength() )
+ if ( !aNames.hasElements() )
{
sal_Int32 nCount = m_xResultSetMetaData->getColumnCount();
aNames.realloc(nCount);
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index ca8dac4694f4..821349e13aa2 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1153,7 +1153,7 @@ void OCopyTableWizard::appendKey( Reference<XKeysSupplier> const & _rxSup, const
{
appendColumns(xColSup,_pVec,true);
Reference<XNameAccess> xColumns = xColSup->getColumns();
- if(xColumns.is() && xColumns->getElementNames().getLength())
+ if(xColumns.is() && xColumns->getElementNames().hasElements())
xAppend->appendByDescriptor(xKey);
}
@@ -1514,7 +1514,7 @@ OUString OCopyTableWizard::createUniqueName(const OUString& _sName)
{
OUString sName = _sName;
Sequence< OUString > aColumnNames( m_rSourceObject.getColumnNames() );
- if ( aColumnNames.getLength() )
+ if ( aColumnNames.hasElements() )
sName = ::dbtools::createUniqueName( aColumnNames, sName, false );
else
{
diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx
index e315c8b81b35..6c0ba95365e1 100644
--- a/dbaccess/source/ui/misc/linkeddocuments.cxx
+++ b/dbaccess/source/ui/misc/linkeddocuments.cxx
@@ -263,7 +263,7 @@ namespace dbaui
if ( xORB.is() )
{
::comphelper::NamedValueCollection aCreationArgs( i_rCreationArgs );
- if ( aClassId.getLength() )
+ if ( aClassId.hasElements() )
aCreationArgs.put( "ClassID", aClassId );
aCreationArgs.put( OUString(PROPERTY_ACTIVE_CONNECTION), m_xConnection );
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 9ed4334768e8..3b4840492269 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -600,7 +600,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >&
setModified(true);
break;
case SID_QUERY_LIMIT:
- if ( aArgs.getLength() >= 1 && aArgs[0].Name == "DBLimit.Value" )
+ if ( aArgs.hasElements() && aArgs[0].Name == "DBLimit.Value" )
{
aArgs[0].Value >>= m_nLimit;
setModified(true);
@@ -767,7 +767,7 @@ void OQueryController::impl_initialize()
Sequence< PropertyValue > aCurrentQueryDesignProps;
aCurrentQueryDesignProps = rArguments.getOrDefault( "CurrentQueryDesign", aCurrentQueryDesignProps );
- if ( aCurrentQueryDesignProps.getLength() )
+ if ( aCurrentQueryDesignProps.hasElements() )
{
::comphelper::NamedValueCollection aCurrentQueryDesign( aCurrentQueryDesignProps );
if ( aCurrentQueryDesign.has( OUString(PROPERTY_GRAPHICAL_DESIGN) ) )
@@ -1678,7 +1678,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings
if ( bValid )
{
// load the layoutInformation
- if ( aLayoutInformation.getLength() )
+ if ( aLayoutInformation.hasElements() )
{
try
{
diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
index 423928905075..397af96134a4 100644
--- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
+++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx
@@ -348,7 +348,7 @@ bool ORelationTableConnectionData::Update()
{
xKey->getPropertyValue(PROPERTY_NAME) >>= sName;
m_aConnName = sName;
- bDropRelation = aNames.getLength() == 0; // the key contains no column, so it isn't valid and we have to drop it
+ bDropRelation = !aNames.hasElements(); // the key contains no column, so it isn't valid and we have to drop it
//here we already know our column structure so we don't have to recreate the table connection data
xColSup.clear();
break;
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 89d07d037729..6da6bd154816 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -1264,7 +1264,7 @@ void OTableController::alterColumns()
bNeedAppendKey = true;
}
- if ( bNeedDropKey && xKeyColumns.is() && xKeyColumns->getElementNames().getLength() )
+ if ( bNeedDropKey && xKeyColumns.is() && xKeyColumns->getElementNames().hasElements() )
dropPrimaryKey();
if ( bNeedAppendKey )
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 295575187044..ee886b365b1b 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -795,7 +795,7 @@ void CopyTableWizard::impl_extractSourceResultSet_throw( const Reference< XPrope
// sanity checks
const bool bHasResultSet = m_xSourceResultSet.is();
- const bool bHasSelection = ( m_aSourceSelection.getLength() != 0 );
+ const bool bHasSelection = m_aSourceSelection.hasElements();
if ( bHasSelection && !bHasResultSet )
throw IllegalArgumentException("A result set is needed when specifying a selection to copy.",
// TODO: resource
@@ -896,7 +896,7 @@ SharedConnection CopyTableWizard::impl_extractConnection_throw( const Reference<
// no connection pool installed
xDriverManager.set( DriverManager::create( m_xContext ), UNO_QUERY_THROW );
- if ( aConnectionInfo.getLength() )
+ if ( aConnectionInfo.hasElements() )
xConnection.set( xDriverManager->getConnectionWithInfo( sConnectionResource, aConnectionInfo ), UNO_SET_THROW );
else
xConnection.set( xDriverManager->getConnection( sConnectionResource ), UNO_SET_THROW );
@@ -1124,7 +1124,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnPositions ), UNO_SET_THROW );
Reference< XParameters > xStatementParams( xStatement, UNO_QUERY_THROW );
- const bool bSelectedRecordsOnly = m_aSourceSelection.getLength() != 0;
+ const bool bSelectedRecordsOnly = m_aSourceSelection.hasElements();
const Any* pSelectedRow = m_aSourceSelection.getConstArray();
const Any* pSelEnd = pSelectedRow + m_aSourceSelection.getLength();