summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-02 22:56:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-03 10:08:31 +0200
commitf20810f7829d9f3b7167df316e1303810b746366 (patch)
tree8a6eb44060c5b4134c24d794e2af3b02b557d885 /svtools
parentf1ba393af4f08f8502906c9221f8b6f1be2a7bad (diff)
Use hasElements to check Sequence emptiness in sfx2..svx
Similar to clang-tidy readability-container-size-empty Change-Id: Icabd773f3b924d465b33e8581175f1fcf70c282e Reviewed-on: https://gerrit.libreoffice.org/71704 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/extcolorcfg.cxx4
-rw-r--r--svtools/source/control/filectrl.cxx2
-rw-r--r--svtools/source/misc/embedtransfer.cxx2
-rw-r--r--svtools/source/misc/imagemgr.cxx2
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx2
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx6
-rw-r--r--svtools/source/uno/wizard/wizardshell.cxx2
7 files changed, 10 insertions, 10 deletions
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 6f195039d4a1..6fdcf0ead67c 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -241,7 +241,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme)
aComponentDisplayNames[0] = componentName + sDisplayName;
uno::Sequence< uno::Any > aComponentDisplayNamesValue = GetProperties( aComponentDisplayNames );
OUString sComponentDisplayName;
- if ( aComponentDisplayNamesValue.getLength() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
+ if ( aComponentDisplayNamesValue.hasElements() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) )
{
m_aComponentDisplayNames.emplace(componentName.getToken(1, '/'),sComponentDisplayName);
}
@@ -327,7 +327,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _
const uno::Any* pColors = aColors.getConstArray();
uno::Sequence< uno::Any > aDefaultColors = GetProperties( aDefaultColorNames );
- bool bDefaultColorFound = aDefaultColors.getLength() != 0;
+ bool bDefaultColorFound = aDefaultColors.hasElements();
const uno::Any* pDefaultColors = aDefaultColors.getConstArray();
OUString* pColorIter = aColorNames.getArray();
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index a2665e420126..e83b9146de6f 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -222,7 +222,7 @@ IMPL_LINK_NOARG(FileControl, ButtonHdl, Button*, void)
{
Sequence < OUString > aPathSeq = xFilePicker->getSelectedFiles();
- if ( aPathSeq.getLength() )
+ if ( aPathSeq.hasElements() )
{
OUString aNewText = aPathSeq[0];
INetURLObject aObj( aNewText );
diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx
index cf242c0efbe5..61ad948ea8da 100644
--- a/svtools/source/misc/embedtransfer.cxx
+++ b/svtools/source/misc/embedtransfer.cxx
@@ -138,7 +138,7 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo
if ( bDeleteStream )
delete pStream;
- bRet = ( aSeq.getLength() > 0 );
+ bRet = aSeq.hasElements();
if( bRet )
{
SetAny( uno::Any(aSeq) );
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 5e688394e4dd..e38760f829b0 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -238,7 +238,7 @@ static OUString GetImageExtensionByFactory_Impl( const OUString& rURL )
if (rProp.Name == "Extensions")
{
css::uno::Sequence < OUString > aExtensions;
- if ( ( rProp.Value >>= aExtensions ) && aExtensions.getLength() > 0 )
+ if ( ( rProp.Value >>= aExtensions ) && aExtensions.hasElements() )
{
const OUString* pExtensions = aExtensions.getConstArray();
aExtension = pExtensions[0];
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index 8462d912535b..5620686ac60c 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -987,7 +987,7 @@ void TreeControlPeer::updateTree( const css::awt::tree::TreeDataModelEvent& rEve
Sequence< Reference< XTreeNode > > Nodes;
Reference< XTreeNode > xNode( rEvent.ParentNode );
- if( !xNode.is() && Nodes.getLength() )
+ if( !xNode.is() && Nodes.hasElements() )
{
xNode = Nodes[0];
}
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index d230dc3c5825..300fa62ae594 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -173,13 +173,13 @@ namespace {
void lcl_checkPaths( const Sequence< Sequence< sal_Int16 > >& i_rPaths, const Reference< XInterface >& i_rContext )
{
// need at least one path
- if ( i_rPaths.getLength() == 0 )
+ if ( !i_rPaths.hasElements() )
throw IllegalArgumentException( OUString(), i_rContext, 2 );
// each path must be of length 1, at least
for ( sal_Int32 i = 0; i < i_rPaths.getLength(); ++i )
{
- if ( i_rPaths[i].getLength() == 0 )
+ if ( !i_rPaths[i].hasElements() )
throw IllegalArgumentException( OUString(), i_rContext, 2 );
// page IDs must be in ascending order
@@ -232,7 +232,7 @@ namespace {
Sequence< Sequence< sal_Int16 > > aMultiplePaths;
i_Arguments[0] >>= aMultiplePaths;
- if ( !aMultiplePaths.getLength() )
+ if ( !aMultiplePaths.hasElements() )
{
aMultiplePaths.realloc(1);
aMultiplePaths[0] = aSinglePath;
diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx
index 5e6916d78287..a7386fc16f3a 100644
--- a/svtools/source/uno/wizard/wizardshell.cxx
+++ b/svtools/source/uno/wizard/wizardshell.cxx
@@ -43,7 +43,7 @@ namespace svt { namespace uno
sal_Int16 lcl_determineFirstPageID( const Sequence< Sequence< sal_Int16 > >& i_rPaths )
{
- ENSURE_OR_THROW( ( i_rPaths.getLength() > 0 ) && ( i_rPaths[0].getLength() > 0 ), "illegal paths" );
+ ENSURE_OR_THROW( i_rPaths.hasElements() && i_rPaths[0].hasElements(), "illegal paths" );
return i_rPaths[0][0];
}
}