summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 23:42:17 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-06-11 20:24:40 +0200
commitc88f76035cd1d088cc06067270677618340fd839 (patch)
tree2e98a3c2c6bdb6ee909d0b7c45012060e57b9a29 /basctl
parentb5d624c4af1085d4670149e9c1d280da7bc9add0 (diff)
Use hasElements to check Sequence emptiness in accessibility..canvas
Similar to clang-tidy readability-container-size-empty Change-Id: I24c3f04b4eed3c1cd973166885660f113a26844f Reviewed-on: https://gerrit.libreoffice.org/71805 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basctl')
-rw-r--r--basctl/source/basicide/baside2b.cxx4
-rw-r--r--basctl/source/basicide/baside3.cxx3
-rw-r--r--basctl/source/basicide/localizationmgr.cxx10
-rw-r--r--basctl/source/basicide/moduldlg.cxx6
-rw-r--r--basctl/source/dlged/dlged.cxx2
-rw-r--r--basctl/source/dlged/propbrw.cxx2
6 files changed, 13 insertions, 14 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index df2b10ef5ab1..4421e78cb6ff 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2897,7 +2897,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const
if( bCanComplete && ( xClass != nullptr ) )
{
Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods();
- if( aMethods.getLength() != 0 )
+ if( aMethods.hasElements() )
{
for(sal_Int32 l = 0; l < aMethods.getLength(); ++l)
{
@@ -2914,7 +2914,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassFields() const
if( bCanComplete && ( xClass != nullptr ) )
{
Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields();
- if( aFields.getLength() != 0 )
+ if( aFields.hasElements() )
{
for(sal_Int32 l = 0; l < aFields.getLength(); ++l)
{
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index c0409fe8b924..eda571040c6b 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -675,8 +675,7 @@ void DialogWindow::SaveDialog()
if( xStringResourceResolver.is() )
{
Sequence< lang::Locale > aLocaleSeq = xStringResourceResolver->getLocales();
- sal_Int32 nLocaleCount = aLocaleSeq.getLength();
- if( nLocaleCount > 0 )
+ if( aLocaleSeq.hasElements() )
bResource = true;
}
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index c0cd940e9c08..db4e8c296b7f 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -67,7 +67,7 @@ LocalizationMgr::LocalizationMgr(
bool LocalizationMgr::isLibraryLocalized ()
{
if (m_xStringResourceManager.is())
- return m_xStringResourceManager->getLocales().getLength() > 0;
+ return m_xStringResourceManager->getLocales().hasElements();
return false;
}
@@ -808,7 +808,7 @@ void LocalizationMgr::setControlResourceIDsForNewEditorObject( DlgEditor const *
LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
// Set resource property
- if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+ if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
return;
OUString aDialogName = pDlgWin->GetName();
@@ -838,7 +838,7 @@ void LocalizationMgr::renameControlResourceIDsForEditorObject( DlgEditor const *
LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
// Set resource property
- if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+ if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
return;
OUString aDialogName = pDlgWin->GetName();
@@ -888,7 +888,7 @@ void LocalizationMgr::setStringResourceAtDialog( const ScriptDocument& rDocument
{
// Not very elegant as dialog may or may not be localized yet
// TODO: Find better place, where dialog is created
- if( xStringResourceManager->getLocales().getLength() > 0 )
+ if( xStringResourceManager->getLocales().hasElements() )
{
Any aDialogCtrl;
aDialogCtrl <<= xDialogModel;
@@ -1037,7 +1037,7 @@ void LocalizationMgr::copyResourcesForPastedEditorObject( DlgEditor const * pEdi
LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
// Set resource property
- if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+ if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
return;
OUString aDialogName = pDlgWin->GetName();
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index dda0bbf1581d..9be10def7547 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -164,7 +164,7 @@ DragDropMode ExtTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeList
Reference< XStringResourceManager > xSourceMgr =
LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
if( xSourceMgr.is() )
- bAllowMove = ( xSourceMgr->getLocales().getLength() == 0 );
+ bAllowMove = !xSourceMgr->getLocales().hasElements();
}
if( bAllowMove )
nMode_ |= DragDropMode::CTRL_MOVE;
@@ -274,14 +274,14 @@ void Shell::CopyDialogResources(
LocalizationMgr::getStringResourceFromDialogLibrary( xSourceDialogLib );
if( !xSourceMgr.is() )
return;
- bool bSourceLocalized = ( xSourceMgr->getLocales().getLength() > 0 );
+ bool bSourceLocalized = xSourceMgr->getLocales().hasElements();
Reference< container::XNameContainer > xDestDialogLib( rDestDoc.getLibrary( E_DIALOGS, rDestLibName, true ) );
Reference< XStringResourceManager > xDestMgr =
LocalizationMgr::getStringResourceFromDialogLibrary( xDestDialogLib );
if( !xDestMgr.is() )
return;
- bool bDestLocalized = ( xDestMgr->getLocales().getLength() > 0 );
+ bool bDestLocalized = xDestMgr->getLocales().hasElements();
if( !bSourceLocalized && !bDestLocalized )
return;
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 82f30d30b1c2..045640691e6f 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -853,7 +853,7 @@ void DlgEditor::Paste()
}
bool bLocalized = false;
if( xStringResourceManager.is() )
- bLocalized = ( xStringResourceManager->getLocales().getLength() > 0 );
+ bLocalized = xStringResourceManager->getLocales().hasElements();
if ( xTransf->isDataFlavorSupported( m_ClipboardDataFlavors[0] ) )
{
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 87983eeaf821..b638496946ea 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -515,7 +515,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
aNewObjects = CreateMultiSelectionSequence( rMarkList );
}
- if ( aNewObjects.getLength() )
+ if ( aNewObjects.hasElements() )
implSetNewObjectSequence( aNewObjects );
else
implSetNewObject( xNewObject );