summaryrefslogtreecommitdiff
path: root/package/source/zippackage/ZipPackage.cxx
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-03 22:11:02 +0300
committerMichael Stahl <Michael.Stahl@cib.de>2019-05-17 11:20:15 +0200
commit0e4c542f7a862e681baf25f042bc3a928c14004f (patch)
tree56582ddb40671a22eaaa54e1ab3058dc553b9d5d /package/source/zippackage/ZipPackage.cxx
parent644ca26af744aec1e66c8dd4199d1228e0f780be (diff)
Use hasElements to check Sequence emptiness in [l-r]*
Similar to clang-tidy readability-container-size-empty Change-Id: Idd67f332b04857a39df26bad1733aae21236f105 Reviewed-on: https://gerrit.libreoffice.org/71764 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'package/source/zippackage/ZipPackage.cxx')
-rw-r--r--package/source/zippackage/ZipPackage.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 42c78532a2db..5a715d3ccfda 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -600,7 +600,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
{
beans::NamedValue aNamedValue;
- if ( aArguments.getLength() )
+ if ( aArguments.hasElements() )
{
bool bHaveZipFile = true;
@@ -1000,7 +1000,7 @@ uno::Reference< XInterface > SAL_CALL ZipPackage::createInstanceWithArguments( c
{
bool bArg = false;
uno::Reference < XInterface > xRef;
- if ( aArguments.getLength() )
+ if ( aArguments.hasElements() )
aArguments[0] >>= bArg;
if ( bArg )
xRef = *new ZipPackageFolder( m_xContext, m_nFormat, m_bAllowRemoveOnInsert );
@@ -1633,7 +1633,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey()
{
uno::Sequence< sal_Int8 > aResult;
- if ( m_aStorageEncryptionKeys.getLength() )
+ if ( m_aStorageEncryptionKeys.hasElements() )
{
OUString aNameToFind;
if ( m_nStartKeyGenerationID == xml::crypto::DigestID::SHA256 )
@@ -1649,7 +1649,7 @@ const uno::Sequence< sal_Int8 > ZipPackage::GetEncryptionKey()
// empty keys are not allowed here
// so it is not important whether there is no key, or the key is empty, it is an error
- if ( !aResult.getLength() )
+ if ( !aResult.hasElements() )
throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" );
}
else
@@ -1753,10 +1753,10 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
// because of this support the storage has to operate with more than one key dependent on storage generation algorithm;
// when this support is removed, the storage will get only one key from outside
uno::Sequence< beans::NamedValue > aKeys;
- if ( !( aValue >>= aKeys ) || ( aKeys.getLength() && aKeys.getLength() < 1 ) )
+ if ( !( aValue >>= aKeys ) )
throw IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 2 );
- if ( aKeys.getLength() )
+ if ( aKeys.hasElements() )
{
bool bHasSHA256 = false;
bool bHasSHA1 = false;
@@ -1778,7 +1778,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
else if ( aPropertyName == ENCRYPTION_ALGORITHMS_PROPERTY )
{
uno::Sequence< beans::NamedValue > aAlgorithms;
- if ( m_pZipFile || !( aValue >>= aAlgorithms ) || aAlgorithms.getLength() == 0 )
+ if ( m_pZipFile || !( aValue >>= aAlgorithms ) || !aAlgorithms.hasElements() )
{
// the algorithms can not be changed if the file has a persistence based on the algorithms ( m_pZipFile )
throw IllegalArgumentException(THROW_WHERE "unexpected algorithms list is provided.", uno::Reference< uno::XInterface >(), 2 );
@@ -1823,7 +1823,7 @@ void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const
else if ( aPropertyName == ENCRYPTION_GPG_PROPERTIES )
{
uno::Sequence< uno::Sequence< beans::NamedValue > > aGpgProps;
- if ( !( aValue >>= aGpgProps ) || aGpgProps.getLength() == 0 )
+ if ( !( aValue >>= aGpgProps ) || !aGpgProps.hasElements() )
{
throw IllegalArgumentException(THROW_WHERE "unexpected Gpg properties are provided.", uno::Reference< uno::XInterface >(), 2 );
}