summaryrefslogtreecommitdiffstats
path: root/xmlsecurity
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-01 00:53:03 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-02 09:53:48 +0200
commit855f52ead7fa361b6a73105d1f0086559a8ed5b6 (patch)
tree042fb792f2c64666ef5fa01436ccafd728860eca /xmlsecurity
parentSort solenv/clang-format/blacklist (diff)
downloadcore-855f52ead7fa361b6a73105d1f0086559a8ed5b6.tar.gz
core-855f52ead7fa361b6a73105d1f0086559a8ed5b6.zip
Use hasElements to check Sequence emptiness in [v-x]*
Similar to clang-tidy readability-container-size-empty Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c Reviewed-on: https://gerrit.libreoffice.org/71603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/source/component/documentdigitalsignatures.cxx2
-rw-r--r--xmlsecurity/source/dialogs/certificateviewer.cxx2
-rw-r--r--xmlsecurity/source/helper/documentsignaturemanager.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/biginteger.cxx2
-rw-r--r--xmlsecurity/source/xmlsec/nss/ciphercontext.cxx6
-rw-r--r--xmlsecurity/source/xmlsec/nss/nssinitializer.cxx4
-rw-r--r--xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx2
7 files changed, 10 insertions, 10 deletions
diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx
index 43b74580d472..5e2f2d5ee056 100644
--- a/xmlsecurity/source/component/documentdigitalsignatures.cxx
+++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx
@@ -207,7 +207,7 @@ void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments)
m_nArgumentsCount = aArguments.getLength();
- if (aArguments.getLength() > 0)
+ if (aArguments.hasElements())
{
if (!(aArguments[0] >>= m_sODFVersion))
throw css::lang::IllegalArgumentException(
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index b1e9ff3c3437..f0023fbcb87e 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -57,7 +57,7 @@ CertificateViewer::CertificateViewer(weld::Window* _pParent,
mxGeneralPage.reset(new CertificateViewerGeneralTP(mxTabCtrl->get_page("general"), this));
mxDetailsPage.reset(new CertificateViewerDetailsTP(mxTabCtrl->get_page("details"), this));
- if (mxSecurityEnvironment->buildCertificatePath(mxCert).getLength() == 0)
+ if (!mxSecurityEnvironment->buildCertificatePath(mxCert).hasElements())
mxTabCtrl->remove_page("path");
else
mxPathId.reset(new CertificateViewerCertPathTP(mxTabCtrl->get_page("path"), this));
diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx
index 8ca9f07f4d64..9cd197e786ae 100644
--- a/xmlsecurity/source/helper/documentsignaturemanager.cxx
+++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx
@@ -133,7 +133,7 @@ bool DocumentSignatureManager::IsXAdESRelevant()
bool DocumentSignatureManager::readManifest()
{
// Check if manifest was already read
- if (m_manifest.getLength() > 0)
+ if (m_manifest.hasElements())
return true;
if (!mxContext.is())
diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx
index 421bbeba3d04..0bfcbd326de1 100644
--- a/xmlsecurity/source/xmlsec/biginteger.cxx
+++ b/xmlsecurity/source/xmlsec/biginteger.cxx
@@ -77,7 +77,7 @@ OUString bigIntegerToNumericString ( const Sequence< sal_Int8 >& integer )
{
OUString aRet ;
- if( integer.getLength() ) {
+ if( integer.hasElements() ) {
xmlSecBn bn ;
xmlChar* chNumeral ;
diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
index af114619e7f9..104414f815de 100644
--- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
+++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx
@@ -103,7 +103,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
throw lang::DisposedException();
uno::Sequence< sal_Int8 > aToConvert;
- if ( aData.getLength() )
+ if ( aData.hasElements() )
{
sal_Int32 nOldLastBlockLen = m_aLastBlock.getLength();
OSL_ENSURE( nOldLastBlockLen <= m_nBlockSize, "Unexpected last block size!" );
@@ -154,7 +154,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c
uno::Sequence< sal_Int8 > aResult;
OSL_ENSURE( aToConvert.getLength() % m_nBlockSize == 0, "Unexpected size of the data to encrypt!" );
- if ( aToConvert.getLength() )
+ if ( aToConvert.hasElements() )
{
int nResultLen = 0;
aResult.realloc( aToConvert.getLength() + m_nBlockSize );
@@ -214,7 +214,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis
OSL_ENSURE( m_aLastBlock.getLength() < m_nBlockSize * 2 , "Unexpected size of cashed incomplete last block!" );
uno::Sequence< sal_Int8 > aResult;
- if ( m_aLastBlock.getLength() )
+ if ( m_aLastBlock.hasElements() )
{
int nPrefResLen = 0;
aResult.realloc( m_aLastBlock.getLength() + m_nBlockSize );
diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
index 238f1bb9e41a..688a94d31a5e 100644
--- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
+++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx
@@ -539,7 +539,7 @@ css::uno::Reference< css::xml::crypto::XDigestContext > SAL_CALL ONSSInitializer
else
throw css::lang::IllegalArgumentException("Unexpected digest requested.", css::uno::Reference< css::uno::XInterface >(), 1 );
- if ( aParams.getLength() )
+ if ( aParams.hasElements() )
throw css::lang::IllegalArgumentException("Unexpected arguments provided for digest creation.", css::uno::Reference< css::uno::XInterface >(), 2 );
css::uno::Reference< css::xml::crypto::XDigestContext > xResult;
@@ -566,7 +566,7 @@ css::uno::Reference< css::xml::crypto::XCipherContext > SAL_CALL ONSSInitializer
if ( aKey.getLength() != 16 && aKey.getLength() != 24 && aKey.getLength() != 32 )
throw css::lang::IllegalArgumentException("Unexpected key length.", css::uno::Reference< css::uno::XInterface >(), 2 );
- if ( aParams.getLength() )
+ if ( aParams.hasElements() )
throw css::lang::IllegalArgumentException("Unexpected arguments provided for cipher creation.", css::uno::Reference< css::uno::XInterface >(), 5 );
css::uno::Reference< css::xml::crypto::XCipherContext > xResult;
diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
index c64b69c2002e..c65d8012af2a 100644
--- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
@@ -482,7 +482,7 @@ X509Certificate_NssImpl* SecurityEnvironment_NssImpl::createX509CertificateFromD
{
X509Certificate_NssImpl* pX509Certificate = nullptr;
- if (aDerCertificate.getLength() > 0)
+ if (aDerCertificate.hasElements())
{
pX509Certificate = new X509Certificate_NssImpl();
if (pX509Certificate == nullptr)