summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-02 13:39:20 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-02 13:37:13 +0200
commitdeffca13fd8a765ddc518cfcff464cb1b6f5c65a (patch)
treee1a34de7398b803bca75fc9dcd69985cc8b9fc18 /ucb
parente2abbc0062398ea67cb13cb5b0b7bfdce78e652c (diff)
Use hasElements to check Sequence emptiness in [t-u]*
Similar to clang-tidy readability-container-size-empty Change-Id: Idefe55e37f5c837c889548ffe7c5711400012a4d Reviewed-on: https://gerrit.libreoffice.org/71667 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/cacher/cachedcontentresultset.cxx2
-rw-r--r--ucb/source/cacher/cacheddynamicresultsetstub.cxx2
-rw-r--r--ucb/source/cacher/contentresultsetwrapper.cxx8
-rw-r--r--ucb/source/core/ucb.cxx6
-rw-r--r--ucb/source/core/ucbstore.cxx2
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx2
-rw-r--r--ucb/source/ucp/ext/ucpext_content.cxx2
-rw-r--r--ucb/source/ucp/ext/ucpext_datasupplier.cxx2
-rw-r--r--ucb/source/ucp/file/bc.cxx2
-rw-r--r--ucb/source/ucp/file/filtask.cxx2
-rw-r--r--ucb/source/ucp/file/prov.cxx2
-rw-r--r--ucb/source/ucp/ftp/ftpcontent.cxx2
-rw-r--r--ucb/source/ucp/gio/gio_content.cxx2
-rw-r--r--ucb/source/ucp/hierarchy/hierarchycontent.cxx2
-rw-r--r--ucb/source/ucp/hierarchy/hierarchydata.cxx2
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.cxx2
-rw-r--r--ucb/source/ucp/package/pkgcontent.cxx2
-rw-r--r--ucb/source/ucp/tdoc/tdoc_content.cxx2
-rw-r--r--ucb/source/ucp/webdav-neon/webdavcontent.cxx4
19 files changed, 25 insertions, 25 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 0765e2baed3b..4b229374b027 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -181,7 +181,7 @@ bool CachedContentResultSet::CCRS_Cache
return ( m_pResult->FetchError & FetchError::ENDOFDATA )
&& m_pResult->Orientation
- && m_pResult->Rows.getLength();
+ && m_pResult->Rows.hasElements();
}
bool CachedContentResultSet::CCRS_Cache
diff --git a/ucb/source/cacher/cacheddynamicresultsetstub.cxx b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
index 927a6ac4e08c..8197a0a6fe15 100644
--- a/ucb/source/cacher/cacheddynamicresultsetstub.cxx
+++ b/ucb/source/cacher/cacheddynamicresultsetstub.cxx
@@ -235,7 +235,7 @@ void SAL_CALL CachedDynamicResultSetStubFactory
OSL_ENSURE( TargetCache.is(), "a TargetCache is needed" );
Reference< XDynamicResultSet > xSource( Source );
- if( SortingInfo.getLength() &&
+ if( SortingInfo.hasElements() &&
!( xSource->getCapabilities() & ContentResultSetCapability::SORTED )
)
{
diff --git a/ucb/source/cacher/contentresultsetwrapper.cxx b/ucb/source/cacher/contentresultsetwrapper.cxx
index be35593388c0..d1e085a3f826 100644
--- a/ucb/source/cacher/contentresultsetwrapper.cxx
+++ b/ucb/source/cacher/contentresultsetwrapper.cxx
@@ -544,7 +544,7 @@ void SAL_CALL ContentResultSetWrapper::addPropertyChangeListener( const OUString
impl_getPropertyChangeListenerContainer();
bool bNeedRegister = !m_pPropertyChangeListeners->
- getContainedTypes().getLength();
+ getContainedTypes().hasElements();
m_pPropertyChangeListeners->addInterface( aPropertyName, xListener );
if( bNeedRegister )
{
@@ -589,7 +589,7 @@ void SAL_CALL ContentResultSetWrapper::addVetoableChangeListener( const OUString
impl_getVetoableChangeListenerContainer();
bool bNeedRegister = !m_pVetoableChangeListeners->
- getContainedTypes().getLength();
+ getContainedTypes().hasElements();
m_pVetoableChangeListeners->addInterface( rPropertyName, xListener );
if( bNeedRegister )
{
@@ -645,7 +645,7 @@ void SAL_CALL ContentResultSetWrapper::removePropertyChangeListener( const OUStr
m_pPropertyChangeListeners->removeInterface( rPropertyName, xListener );
- if( !m_pPropertyChangeListeners->getContainedTypes().getLength() )
+ if( !m_pPropertyChangeListeners->getContainedTypes().hasElements() )
{
impl_init_xPropertySetOrigin();
{
@@ -698,7 +698,7 @@ void SAL_CALL ContentResultSetWrapper::removeVetoableChangeListener( const OUStr
m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener );
- if( !m_pVetoableChangeListeners->getContainedTypes().getLength() )
+ if( !m_pVetoableChangeListeners->getContainedTypes().hasElements() )
{
impl_init_xPropertySetOrigin();
{
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index 24687458cf64..907cef806449 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -364,9 +364,9 @@ void SAL_CALL UniversalContentBroker::initialize( const css::uno::Sequence< Any
{
{
osl::MutexGuard aGuard(m_aMutex);
- if (m_aArguments.getLength() != 0)
+ if (m_aArguments.hasElements())
{
- if (aArguments.getLength() != 0
+ if (aArguments.hasElements()
&& !(m_aArguments.getLength() == 2
&& aArguments.getLength() == 2
&& m_aArguments[0] == aArguments[0]
@@ -378,7 +378,7 @@ void SAL_CALL UniversalContentBroker::initialize( const css::uno::Sequence< Any
}
return;
}
- if (aArguments.getLength() == 0)
+ if (!aArguments.hasElements())
{
m_aArguments.realloc(2);
m_aArguments[0] <<= OUString("Local");
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index eb28a1eb3a7b..b746167807a4 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -889,7 +889,7 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
{
const Sequence< Any >& rInitArgs = m_pImpl->m_aInitArgs;
- if ( rInitArgs.getLength() > 0 )
+ if ( rInitArgs.hasElements() )
{
// Extract config provider from service init args.
rInitArgs[ 0 ] >>= m_pImpl->m_xConfigProvider;
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 8a680d6193bb..2f5dd71fc857 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -1794,7 +1794,7 @@ namespace cmis
else if ( aCommand.Name == "setPropertyValues" )
{
uno::Sequence< beans::PropertyValue > aProperties;
- if ( !( aCommand.Argument >>= aProperties ) || !aProperties.getLength() )
+ if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv );
}
diff --git a/ucb/source/ucp/ext/ucpext_content.cxx b/ucb/source/ucp/ext/ucpext_content.cxx
index 9d5376c14d7c..f55c3418cc48 100644
--- a/ucb/source/ucp/ext/ucpext_content.cxx
+++ b/ucb/source/ucp/ext/ucpext_content.cxx
@@ -211,7 +211,7 @@ namespace ucb { namespace ucp { namespace ext
// unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
index 9d6f962119c0..1f4543b22959 100644
--- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx
+++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
@@ -129,7 +129,7 @@ namespace ucb { namespace ucp { namespace ext
Sequence< Sequence< OUString > > aExtensionInfo( xPackageInfo->getExtensionList() );
for ( auto const & extInfo : aExtensionInfo )
{
- if ( extInfo.getLength() <= 0 )
+ if ( !extInfo.hasElements() )
{
SAL_WARN( "ucb.ucp.ext", "illegal extension info" );
continue;
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index eb2d7d9b8489..2e5538286f00 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -399,7 +399,7 @@ BaseContent::addPropertiesChangeListener(
m_pPropertyListener.reset( new PropertyListeners( m_aEventListenerMutex ) );
- if( PropertyNames.getLength() == 0 )
+ if( !PropertyNames.hasElements() )
m_pPropertyListener->addInterface( OUString(),Listener );
else
{
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 1930d8cc5f07..5a81536bdf38 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2895,7 +2895,7 @@ TaskManager::copyPersistentSet( const OUString& srcUnqPath,
uno::Sequence< beans::Property > seqProperty =
x_src->getPropertySetInfo()->getProperties();
- if( seqProperty.getLength() )
+ if( seqProperty.hasElements() )
{
uno::Reference< XPersistentPropertySet >
x_dstS = m_xFileRegistry->openPropertySet( new_Name,true );
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 197f45279caf..368876d90540 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -112,7 +112,7 @@ FileProvider::initialize(
{
if( ! m_pMyShell ) {
OUString config;
- if( aArguments.getLength() > 0 &&
+ if( aArguments.hasElements() &&
(aArguments[0] >>= config) &&
config == "NoConfig" )
m_pMyShell.reset( new TaskManager( m_xContext, this, false ) );
diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx
index 9962b7b1d465..93cf2bf2b82f 100644
--- a/ucb/source/ucp/ftp/ftpcontent.cxx
+++ b/ucb/source/ucp/ftp/ftpcontent.cxx
@@ -830,7 +830,7 @@ Sequence<Any> FTPContent::setPropertyValues(
}
}
- if(evt.getLength()) {
+ if(evt.hasElements()) {
// title has changed
notifyPropertiesChange(evt);
(void)exchange(new FTPContentIdentifier(m_aFTPURL.ident(false,false)));
diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx
index e3f2c0cb0222..087965399d86 100644
--- a/ucb/source/ucp/gio/gio_content.cxx
+++ b/ucb/source/ucp/gio/gio_content.cxx
@@ -968,7 +968,7 @@ uno::Any SAL_CALL Content::execute(
else if ( aCommand.Name == "setPropertyValues" )
{
uno::Sequence< beans::PropertyValue > aProperties;
- if ( !( aCommand.Argument >>= aProperties ) || !aProperties.getLength() )
+ if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv );
}
diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
index 056527010065..e0ac3c81fda7 100644
--- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx
@@ -340,7 +340,7 @@ uno::Any SAL_CALL HierarchyContent::execute(
// Unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
diff --git a/ucb/source/ucp/hierarchy/hierarchydata.cxx b/ucb/source/ucp/hierarchy/hierarchydata.cxx
index 1c626cc3deec..158cf62905f5 100644
--- a/ucb/source/ucp/hierarchy/hierarchydata.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchydata.cxx
@@ -927,7 +927,7 @@ bool HierarchyEntry::first( iterator const & it )
}
}
- if ( it.m_pImpl->names.getLength() == 0 )
+ if ( !it.m_pImpl->names.hasElements() )
return false;
it.m_pImpl->pos = 0;
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index 8dc85b8706ad..022f6ec7beb5 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -163,7 +163,7 @@ HierarchyContentProvider::queryContent(
void SAL_CALL HierarchyContentProvider::initialize(
const uno::Sequence< uno::Any >& aArguments )
{
- if ( aArguments.getLength() > 0 )
+ if ( aArguments.hasElements() )
OSL_FAIL( "HierarchyContentProvider::initialize : not supported!" );
}
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx
index 2facec6e88a9..dba85a3a9d30 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -436,7 +436,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index e74039e9a0d8..9dd5b6e6ae98 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -365,7 +365,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index 9c139fb4a30d..bd05e53fd880 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -493,7 +493,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
- if ( !aProperties.getLength() )
+ if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
@@ -1392,7 +1392,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
aProperties = rProperties;
}
- if ( aProperties.getLength() > 0 )
+ if ( aProperties.hasElements() )
ContentProperties::UCBNamesToDAVNames(
aProperties, aPropNames );