diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-04 23:16:48 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-10 10:55:57 +0200 |
commit | 1eb8859813ff43b3753dcbab9e3e0bdfe7d72edb (patch) | |
tree | 4e04ab9584a5ef874faf8141c962158c32448d35 /comphelper | |
parent | ec905d131374f0860bac77c52873eed984b1966f (diff) |
Use hasElements to check Sequence emptiness in chart2..connectivity
Similar to clang-tidy readability-container-size-empty
Change-Id: I41824e8a4ef38d6a35a0ac4421cffcbcd17308e1
Reviewed-on: https://gerrit.libreoffice.org/71802
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/compare/AnyCompareFactory.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/container/enumerablemap.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/misc/docpasswordhelper.cxx | 10 | ||||
-rw-r--r-- | comphelper/source/misc/mimeconfighelper.cxx | 6 | ||||
-rw-r--r-- | comphelper/source/property/ChainablePropertySetInfo.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/property/MasterPropertySetInfo.cxx | 2 | ||||
-rw-r--r-- | comphelper/source/xml/ofopxmlhelper.cxx | 6 |
7 files changed, 15 insertions, 15 deletions
diff --git a/comphelper/source/compare/AnyCompareFactory.cxx b/comphelper/source/compare/AnyCompareFactory.cxx index 5ad36c5eb615..928456bd79f3 100644 --- a/comphelper/source/compare/AnyCompareFactory.cxx +++ b/comphelper/source/compare/AnyCompareFactory.cxx @@ -96,7 +96,7 @@ Reference< XAnyCompare > SAL_CALL AnyCompareFactory::createAnyCompareByName( con void SAL_CALL AnyCompareFactory::initialize( const Sequence< Any >& aArguments ) { - if( aArguments.getLength() ) + if( aArguments.hasElements() ) { if( aArguments[0] >>= m_Locale ) { diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index 4c97c6718cea..fef9a74f90b5 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -351,7 +351,7 @@ namespace comphelper m_aData.m_pValues.reset( new KeyedValues( *m_aData.m_pKeyCompare ) ); m_aData.m_bMutable = bMutable; - if ( aInitialValues.getLength() ) + if ( aInitialValues.hasElements() ) impl_initValues_throw( aInitialValues ); setInitialized(); diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 9134e7d050a2..7bae3a77aaf0 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -60,7 +60,7 @@ static uno::Sequence< sal_Int8 > GeneratePBKDF2Hash( const OUString& aPassword, { uno::Sequence< sal_Int8 > aResult; - if ( !aPassword.isEmpty() && aSalt.getLength() && nCount && nHashLength ) + if ( !aPassword.isEmpty() && aSalt.hasElements() && nCount && nHashLength ) { OString aBytePass = OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 ); // FIXME this is subject to the SHA1-bug tdf#114939 - see also @@ -92,7 +92,7 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo sal_Int32 const nPBKDF2IterationCount = 100000; uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash(aPassword, aSalt, nPBKDF2IterationCount, 16); - if ( aNewHash.getLength() ) + if ( aNewHash.hasElements() ) { aResult.realloc( 4 ); aResult[0].Name = "algorithm-name"; @@ -112,7 +112,7 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo bool DocPasswordHelper::IsModifyPasswordCorrect( const OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo ) { bool bResult = false; - if ( !aPassword.isEmpty() && aInfo.getLength() ) + if ( !aPassword.isEmpty() && aInfo.hasElements() ) { OUString sAlgorithm; uno::Sequence< sal_Int8 > aSalt; @@ -131,7 +131,7 @@ bool DocPasswordHelper::IsModifyPasswordCorrect( const OUString& aPassword, cons aInfo[nInd].Value >>= aHash; } - if ( sAlgorithm == "PBKDF2" && aSalt.getLength() && nCount > 0 && aHash.getLength() ) + if ( sAlgorithm == "PBKDF2" && aSalt.hasElements() && nCount > 0 && aHash.hasElements() ) { uno::Sequence< sal_Int8 > aNewHash = GeneratePBKDF2Hash( aPassword, aSalt, nCount, aHash.getLength() ); for ( sal_Int32 nInd = 0; nInd < aNewHash.getLength() && nInd < aHash.getLength() && aNewHash[nInd] == aHash[nInd]; nInd ++ ) @@ -446,7 +446,7 @@ OUString DocPasswordHelper::GetOoxHashAsBase64( // try media encryption data (skip, if result is OK or ABORT) if( eResult == DocPasswordVerifierResult::WrongPassword ) { - if( rMediaEncData.getLength() > 0 ) + if( rMediaEncData.hasElements() ) { eResult = rVerifier.verifyEncryptionData( rMediaEncData ); if( eResult == DocPasswordVerifierResult::OK ) diff --git a/comphelper/source/misc/mimeconfighelper.cxx b/comphelper/source/misc/mimeconfighelper.cxx index 5d7249c5f04b..24e5626e4593 100644 --- a/comphelper/source/misc/mimeconfighelper.cxx +++ b/comphelper/source/misc/mimeconfighelper.cxx @@ -422,7 +422,7 @@ uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByMedi { uno::Sequence< beans::NamedValue > aObject = GetObjectPropsByStringClassID( GetExplicitlyRegisteredObjClassID( aMediaType ) ); - if ( aObject.getLength() ) + if ( aObject.hasElements() ) return aObject; OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType ); @@ -802,7 +802,7 @@ OUString MimeConfigurationHelper::GetExportFilterFromImportFilter( const OUStrin SfxFilterFlags::EXPORT, SfxFilterFlags::INTERNAL ); - if ( aExportFilterProps.getLength() ) + if ( aExportFilterProps.hasElements() ) { SequenceAsHashMap aExpPropsHM( aExportFilterProps ); aExportFilterName = aExpPropsHM.getUnpackedValueOrDefault( "Name", OUString() ); @@ -849,7 +849,7 @@ uno::Sequence< beans::PropertyValue > MimeConfigurationHelper::SearchForFilter( aFilterProps = aProps; break; } - else if ( !aFilterProps.getLength() ) + else if ( !aFilterProps.hasElements() ) aFilterProps = aProps; } } diff --git a/comphelper/source/property/ChainablePropertySetInfo.cxx b/comphelper/source/property/ChainablePropertySetInfo.cxx index 241826c056c1..26cf2f6e3d70 100644 --- a/comphelper/source/property/ChainablePropertySetInfo.cxx +++ b/comphelper/source/property/ChainablePropertySetInfo.cxx @@ -45,7 +45,7 @@ ChainablePropertySetInfo::~ChainablePropertySetInfo() void ChainablePropertySetInfo::remove( const OUString& aName ) { maMap.erase ( aName ); - if ( maProperties.getLength() ) + if ( maProperties.hasElements() ) maProperties.realloc( 0 ); } diff --git a/comphelper/source/property/MasterPropertySetInfo.cxx b/comphelper/source/property/MasterPropertySetInfo.cxx index a64f3973c772..6aa017de92da 100644 --- a/comphelper/source/property/MasterPropertySetInfo.cxx +++ b/comphelper/source/property/MasterPropertySetInfo.cxx @@ -46,7 +46,7 @@ MasterPropertySetInfo::~MasterPropertySetInfo() void MasterPropertySetInfo::add( PropertyInfoHash &rHash, sal_uInt8 nMapId ) { - if( maProperties.getLength() ) + if( maProperties.hasElements() ) maProperties.realloc( 0 ); for( const auto& rObj : rHash ) diff --git a/comphelper/source/xml/ofopxmlhelper.cxx b/comphelper/source/xml/ofopxmlhelper.cxx index f096c61ad248..21f097531363 100644 --- a/comphelper/source/xml/ofopxmlhelper.cxx +++ b/comphelper/source/xml/ofopxmlhelper.cxx @@ -379,7 +379,7 @@ void SAL_CALL OFOPXMLHelper_Impl::startElement( const OUString& aName, const uno m_aElementsSeq.push_back( aName ); - if ( !m_aResultSeq.getLength() ) + if ( !m_aResultSeq.hasElements() ) m_aResultSeq.realloc( 2 ); return; // nothing to do @@ -392,7 +392,7 @@ void SAL_CALL OFOPXMLHelper_Impl::startElement( const OUString& aName, const uno m_aElementsSeq.push_back( aName ); - if ( !m_aResultSeq.getLength() ) + if ( !m_aResultSeq.hasElements() ) m_aResultSeq.realloc( 2 ); if ( m_aResultSeq.getLength() != 2 ) @@ -420,7 +420,7 @@ void SAL_CALL OFOPXMLHelper_Impl::startElement( const OUString& aName, const uno m_aElementsSeq.push_back( aName ); - if ( !m_aResultSeq.getLength() ) + if ( !m_aResultSeq.hasElements() ) m_aResultSeq.realloc( 2 ); if ( m_aResultSeq.getLength() != 2 ) |