summaryrefslogtreecommitdiffstats
path: root/svl
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 /svl
parentclang-tidy modernize-avoid-c-arrays in accessibility (diff)
downloadcore-f20810f7829d9f3b7167df316e1303810b746366.tar.gz
core-f20810f7829d9f3b7167df316e1303810b746366.zip
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 'svl')
-rw-r--r--svl/source/config/cjkoptions.cxx2
-rw-r--r--svl/source/config/ctloptions.cxx2
-rw-r--r--svl/source/config/languageoptions.cxx2
-rw-r--r--svl/source/fsstor/ostreamcontainer.cxx4
-rw-r--r--svl/source/items/lckbitem.cxx2
-rw-r--r--svl/source/numbers/zforfind.cxx8
-rw-r--r--svl/source/passwordcontainer/passwordcontainer.cxx4
7 files changed, 12 insertions, 12 deletions
diff --git a/svl/source/config/cjkoptions.cxx b/svl/source/config/cjkoptions.cxx
index a0af655e8950..32cd9d5ce834 100644
--- a/svl/source/config/cjkoptions.cxx
+++ b/svl/source/config/cjkoptions.cxx
@@ -146,7 +146,7 @@ void SvtCJKOptions_Impl::SetAll(bool bSet)
void SvtCJKOptions_Impl::Load()
{
Sequence<OUString> &rPropertyNames = PropertyNames::get();
- if(!rPropertyNames.getLength())
+ if(!rPropertyNames.hasElements())
{
rPropertyNames.realloc(9);
OUString* pNames = rPropertyNames.getArray();
diff --git a/svl/source/config/ctloptions.cxx b/svl/source/config/ctloptions.cxx
index 801901d33b04..81bb44049a75 100644
--- a/svl/source/config/ctloptions.cxx
+++ b/svl/source/config/ctloptions.cxx
@@ -230,7 +230,7 @@ void SvtCTLOptions_Impl::ImplCommit()
void SvtCTLOptions_Impl::Load()
{
Sequence< OUString >& rPropertyNames = PropertyNames::get();
- if ( !rPropertyNames.getLength() )
+ if ( !rPropertyNames.hasElements() )
{
rPropertyNames.realloc(6);
OUString* pNames = rPropertyNames.getArray();
diff --git a/svl/source/config/languageoptions.cxx b/svl/source/config/languageoptions.cxx
index 23590b2e93bd..f00812b30b8d 100644
--- a/svl/source/config/languageoptions.cxx
+++ b/svl/source/config/languageoptions.cxx
@@ -199,7 +199,7 @@ SvtSystemLanguageOptions::SvtSystemLanguageOptions() :
uno::Sequence< OUString > aPropertyNames { "SystemLocale" };
uno::Sequence< uno::Any > aValues = GetProperties( aPropertyNames );
- if ( aValues.getLength() )
+ if ( aValues.hasElements() )
{
aValues[0]>>= m_sWin16SystemLocale;
}
diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx
index d13beb4509d7..ef74bacbe7b0 100644
--- a/svl/source/fsstor/ostreamcontainer.cxx
+++ b/svl/source/fsstor/ostreamcontainer.cxx
@@ -135,11 +135,11 @@ void SAL_CALL OFSStreamContainer::release()
// XTypeProvider
uno::Sequence< uno::Type > SAL_CALL OFSStreamContainer::getTypes()
{
- if ( m_aTypes.getLength() == 0 )
+ if ( !m_aTypes.hasElements() )
{
::osl::MutexGuard aGuard( m_aMutex );
- if ( m_aTypes.getLength() == 0 )
+ if ( !m_aTypes.hasElements() )
{
std::vector<uno::Type> tmp;
tmp.push_back(cppu::UnoType<lang::XTypeProvider>::get());
diff --git a/svl/source/items/lckbitem.cxx b/svl/source/items/lckbitem.cxx
index a610380243cc..46e266d6204c 100644
--- a/svl/source/items/lckbitem.cxx
+++ b/svl/source/items/lckbitem.cxx
@@ -57,7 +57,7 @@ bool SfxLockBytesItem::PutValue( const css::uno::Any& rVal, sal_uInt8 )
css::uno::Sequence< sal_Int8 > aSeq;
if ( rVal >>= aSeq )
{
- if ( aSeq.getLength() )
+ if ( aSeq.hasElements() )
{
SvMemoryStream* pStream = new SvMemoryStream();
pStream->WriteBytes( aSeq.getConstArray(), aSeq.getLength() );
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index bff0e3efa449..0635739de77e 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -1234,7 +1234,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
{
nAcceptedDatePattern = -1;
}
- else if (!sDateAcceptancePatterns.getLength())
+ else if (!sDateAcceptancePatterns.hasElements())
{
// The current locale is the format's locale, if a format is present.
const NfEvalDateFormat eEDF = pFormatter->GetEvalDateFormat();
@@ -1276,8 +1276,8 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
break;
}
}
- SAL_WARN_IF( !sDateAcceptancePatterns.getLength(), "svl.numbers", "ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns");
- nAcceptedDatePattern = (sDateAcceptancePatterns.getLength() ? -2 : -1);
+ SAL_WARN_IF( !sDateAcceptancePatterns.hasElements(), "svl.numbers", "ImpSvNumberInputScan::IsAcceptedDatePattern: no date acceptance patterns");
+ nAcceptedDatePattern = (sDateAcceptancePatterns.hasElements() ? -2 : -1);
}
if (nAcceptedDatePattern == -1)
@@ -3590,7 +3590,7 @@ void ImpSvNumberInputScan::ChangeIntl()
void ImpSvNumberInputScan::InvalidateDateAcceptancePatterns()
{
- if (sDateAcceptancePatterns.getLength())
+ if (sDateAcceptancePatterns.hasElements())
{
sDateAcceptancePatterns = css::uno::Sequence< OUString >();
}
diff --git a/svl/source/passwordcontainer/passwordcontainer.cxx b/svl/source/passwordcontainer/passwordcontainer.cxx
index 38a6bfd134dc..5c59f976d8ec 100644
--- a/svl/source/passwordcontainer/passwordcontainer.cxx
+++ b/svl/source/passwordcontainer/passwordcontainer.cxx
@@ -703,7 +703,7 @@ bool PasswordContainer::createUrlRecord(
{
Sequence< UserRecord > aUsrRec
= FindUsr( rIter->second, aName, aHandler );
- if( aUsrRec.getLength() )
+ if( aUsrRec.hasElements() )
{
rRec = UrlRecord( rIter->first, aUsrRec );
return true;
@@ -1001,7 +1001,7 @@ Sequence< UrlRecord > SAL_CALL PasswordContainer::getAllPersistent( const Refere
aUsers[ oldLen ] = UserRecord( aNP.GetUserName(), comphelper::containerToSequence( DecodePasswords( aNP.GetPersPasswords(), GetMasterPassword( xHandler ), css::task::PasswordRequestMode_PASSWORD_ENTER ) ) );
}
- if( aUsers.getLength() )
+ if( aUsers.hasElements() )
{
sal_Int32 oldLen = aResult.getLength();
aResult.realloc( oldLen + 1 );