summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
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/ui
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/ui')
-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
14 files changed, 24 insertions, 24 deletions
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();