[Libreoffice-commits] core.git: lingucomponent/source linguistic/source oox/source package/source pyuno/source reportdesign/source

Arkadiy Illarionov (via logerrit) logerrit at kemper.freedesktop.org
Fri May 17 09:21:12 UTC 2019


 lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx |    6 ++---
 lingucomponent/source/spellcheck/spell/sspellimp.cxx  |    6 ++---
 lingucomponent/source/thesaurus/libnth/nthesimp.cxx   |   14 ++++++------
 linguistic/source/gciterator.cxx                      |    4 +--
 linguistic/source/hyphdsp.cxx                         |   14 ++++++------
 linguistic/source/lngsvcmgr.cxx                       |   20 +++++++++---------
 linguistic/source/spelldsp.cxx                        |    8 +++----
 linguistic/source/thesdsp.cxx                         |    8 +++----
 oox/source/core/filterbase.cxx                        |    2 -
 oox/source/core/filterdetect.cxx                      |    2 -
 oox/source/core/xmlfilterbase.cxx                     |    2 -
 oox/source/drawingml/chart/chartspaceconverter.cxx    |    4 +--
 oox/source/drawingml/customshapeproperties.cxx        |    2 -
 oox/source/drawingml/shape.cxx                        |    6 ++---
 oox/source/export/chartexport.cxx                     |   10 ++++-----
 oox/source/export/drawingml.cxx                       |   20 +++++++++---------
 oox/source/export/shapes.cxx                          |    2 -
 oox/source/helper/zipstorage.cxx                      |    2 -
 oox/source/ole/olestorage.cxx                         |    2 -
 package/source/xstor/owriteablestream.cxx             |    8 +++----
 package/source/xstor/xstorage.cxx                     |    2 -
 package/source/zipapi/XBufferedThreadedStream.cxx     |    2 -
 package/source/zipapi/XUnbufferedStream.cxx           |    8 +++----
 package/source/zipapi/ZipFile.cxx                     |   20 +++++++++---------
 package/source/zipapi/ZipOutputEntry.cxx              |    2 -
 package/source/zippackage/ZipPackage.cxx              |   16 +++++++-------
 package/source/zippackage/ZipPackageFolder.cxx        |    2 -
 package/source/zippackage/ZipPackageStream.cxx        |   16 +++++++-------
 package/source/zippackage/zipfileaccess.cxx           |    2 -
 pyuno/source/module/pyuno_adapter.cxx                 |    2 -
 reportdesign/source/core/api/ReportDefinition.cxx     |    2 -
 reportdesign/source/filter/xml/xmlControlProperty.cxx |    2 -
 reportdesign/source/filter/xml/xmlExport.cxx          |    2 -
 reportdesign/source/ui/dlg/GroupExchange.cxx          |    2 -
 reportdesign/source/ui/dlg/GroupsSorting.cxx          |    8 +++----
 reportdesign/source/ui/dlg/Navigator.cxx              |    2 -
 reportdesign/source/ui/report/ReportController.cxx    |   16 +++++++-------
 reportdesign/source/ui/report/ReportSection.cxx       |    2 -
 reportdesign/source/ui/report/ViewsWindow.cxx         |    2 -
 reportdesign/source/ui/report/propbrw.cxx             |    4 +--
 40 files changed, 128 insertions(+), 128 deletions(-)

New commits:
commit 0e4c542f7a862e681baf25f042bc3a928c14004f
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Fri May 3 22:11:02 2019 +0300
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri May 17 11:20:15 2019 +0200

    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 at cib.de>

diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index 8ad50fa36915..bc4d91038a25 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -171,8 +171,8 @@ Sequence< Locale > SAL_CALL Hyphenator::getLocales()
             k = 0;
             for (auto const& dict :  aDics)
             {
-                if (dict.aLocaleNames.getLength() > 0 &&
-                    dict.aLocations.getLength() > 0)
+                if (dict.aLocaleNames.hasElements() &&
+                    dict.aLocations.hasElements())
                 {
                     uno::Sequence< OUString > aLocaleNames(dict.aLocaleNames);
                     sal_Int32 nLocales = aLocaleNames.getLength();
@@ -218,7 +218,7 @@ sal_Bool SAL_CALL Hyphenator::hasLocale(const Locale& rLocale)
     MutexGuard  aGuard( GetLinguMutex() );
 
     bool bRes = false;
-    if (!aSuppLocales.getLength())
+    if (!aSuppLocales.hasElements())
         getLocales();
 
     const Locale *pLocale = aSuppLocales.getConstArray();
diff --git a/lingucomponent/source/spellcheck/spell/sspellimp.cxx b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
index 3462899714a2..64032ad14b2d 100644
--- a/lingucomponent/source/spellcheck/spell/sspellimp.cxx
+++ b/lingucomponent/source/spellcheck/spell/sspellimp.cxx
@@ -197,8 +197,8 @@ Sequence< Locale > SAL_CALL SpellChecker::getLocales()
             m_DictItems.reserve(nDictSize);
             for (auto const& dict : aDics)
             {
-                if (dict.aLocaleNames.getLength() > 0 &&
-                    dict.aLocations.getLength() > 0)
+                if (dict.aLocaleNames.hasElements() &&
+                    dict.aLocations.hasElements())
                 {
                     uno::Sequence< OUString > aLocaleNames( dict.aLocaleNames );
 
@@ -235,7 +235,7 @@ sal_Bool SAL_CALL SpellChecker::hasLocale(const Locale& rLocale)
     MutexGuard  aGuard( GetLinguMutex() );
 
     bool bRes = false;
-    if (!m_aSuppLocales.getLength())
+    if (!m_aSuppLocales.hasElements())
         getLocales();
 
     for (auto const& suppLocale : m_aSuppLocales)
diff --git a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
index 88709304521d..f17e19081294 100644
--- a/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
+++ b/lingucomponent/source/thesaurus/libnth/nthesimp.cxx
@@ -175,8 +175,8 @@ Sequence< Locale > SAL_CALL Thesaurus::getLocales()
             k = 0;
             for (auto const& dict : aDics)
             {
-                if (dict.aLocaleNames.getLength() > 0 &&
-                    dict.aLocations.getLength() > 0)
+                if (dict.aLocaleNames.hasElements() &&
+                    dict.aLocations.hasElements())
                 {
                     uno::Sequence< OUString > aLocaleNames(dict.aLocaleNames);
                     sal_Int32 nLocales = aLocaleNames.getLength();
@@ -220,7 +220,7 @@ sal_Bool SAL_CALL Thesaurus::hasLocale(const Locale& rLocale)
     MutexGuard  aGuard( GetLinguMutex() );
 
     bool bRes = false;
-    if (!aSuppLocales.getLength())
+    if (!aSuppLocales.hasElements())
         getLocales();
     sal_Int32 nLen = aSuppLocales.getLength();
     for (sal_Int32 i = 0;  i < nLen;  ++i)
@@ -344,7 +344,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM
             if (xTmpRes2.is())
             {
                 Sequence<OUString>seq = xTmpRes2->getAlternatives();
-                if (seq.getLength() > 0)
+                if (seq.hasElements())
                 {
                     codeTerm = seq[0];
                     stem2 = 1;
@@ -381,7 +381,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM
                         if (xTmpRes.is())
                         {
                             Sequence<OUString>seq = xTmpRes->getAlternatives();
-                            if (seq.getLength() > 0)
+                            if (seq.hasElements())
                                 sTerm = seq[0];
                         }
                     }
@@ -437,7 +437,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM
         if (xTmpRes.is())
         {
             Sequence<OUString>seq = xTmpRes->getAlternatives();
-            if (seq.getLength() > 0)
+            if (seq.hasElements())
             {
                 aRTerm = seq[0];  // XXX Use only the first stem
                 continue;
@@ -454,7 +454,7 @@ Sequence < Reference < css::linguistic2::XMeaning > > SAL_CALL Thesaurus::queryM
         if (xTmpRes.is())
         {
             Sequence<OUString>seq = xTmpRes->getAlternatives();
-            if (seq.getLength() > 0)
+            if (seq.hasElements())
             {
                 aPTerm = aRTerm.copy(pos + 1);
                 aRTerm = aRTerm.copy(0, pos + 1) + seq[0];
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 62322ae67032..7aca99026250 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -1093,7 +1093,7 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl()
             uno::Any aTmp( xNA->getByName( pElementNames[i] ) );
             if (aTmp >>= aImplNames)
             {
-                if (aImplNames.getLength() > 0)
+                if (aImplNames.hasElements())
                 {
                     // only the first entry is used, there should be only one grammar checker per language
                     const OUString aImplName( aImplNames[0] );
@@ -1149,7 +1149,7 @@ void GrammarCheckingIterator::SetServiceList(
 
     LanguageType nLanguage = LinguLocaleToLanguage( rLocale );
     OUString aImplName;
-    if (rSvcImplNames.getLength() > 0)
+    if (rSvcImplNames.hasElements())
         aImplName = rSvcImplNames[0];   // there is only one grammar checker per language
 
     if (!LinguIsUnspecified(nLanguage) && nLanguage != LANGUAGE_DONTKNOW)
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 38cd240c2b76..fa0a77ff20a5 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -328,13 +328,13 @@ Reference< XHyphenatedWord > SAL_CALL
         }
         else
         {
-            sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0;
+            sal_Int32 nLen = pEntry->aSvcImplNames.hasElements() ? 1 : 0;
             DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen,
                     "lng : index out of range");
 
             sal_Int32 i = 0;
             Reference< XHyphenator > xHyph;
-            if (pEntry->aSvcRefs.getLength() > 0)
+            if (pEntry->aSvcRefs.hasElements())
                 xHyph = pEntry->aSvcRefs[0];
 
             // try already instantiated service
@@ -460,13 +460,13 @@ Reference< XHyphenatedWord > SAL_CALL
         }
         else
         {
-            sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0;
+            sal_Int32 nLen = pEntry->aSvcImplNames.hasElements() ? 1 : 0;
             DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen,
                     "lng : index out of range");
 
             sal_Int32 i = 0;
             Reference< XHyphenator > xHyph;
-            if (pEntry->aSvcRefs.getLength() > 0)
+            if (pEntry->aSvcRefs.hasElements())
                 xHyph = pEntry->aSvcRefs[0];
 
             // try already instantiated service
@@ -582,13 +582,13 @@ Reference< XPossibleHyphens > SAL_CALL
         }
         else
         {
-            sal_Int32 nLen = pEntry->aSvcImplNames.getLength() > 0 ? 1 : 0;
+            sal_Int32 nLen = pEntry->aSvcImplNames.hasElements() ? 1 : 0;
             DBG_ASSERT( pEntry->nLastTriedSvcIndex < nLen,
                     "lng : index out of range");
 
             sal_Int32 i = 0;
             Reference< XHyphenator > xHyph;
-            if (pEntry->aSvcRefs.getLength() > 0)
+            if (pEntry->aSvcRefs.hasElements())
                 xHyph = pEntry->aSvcRefs[0];
 
             // try already instantiated service
@@ -700,7 +700,7 @@ Sequence< OUString >
     if (pEntry)
     {
         aRes = pEntry->aSvcImplNames;
-        if (aRes.getLength() > 0)
+        if (aRes.hasElements())
             aRes.realloc(1);
     }
 
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 0c8e8e92f6d5..2f87177c2f1a 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -565,7 +565,7 @@ namespace
         {
             Sequence< OUString > aNames { rLastFoundList + "/" + rCfgLocaleStr };
             Sequence< Any > aValues( rCfg.GetProperties( aNames ) );
-            if (aValues.getLength())
+            if (aValues.hasElements())
             {
                 SAL_WARN_IF( aValues.getLength() != 1, "linguistic", "unexpected length of sequence" );
                 Sequence< OUString > aSvcImplNames;
@@ -799,7 +799,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pNames[0] = aSpellCheckerList + "/" + aKeyText;
                 aValues = /*aCfg.*/GetProperties( aNames );
                 uno::Sequence< OUString > aSvcImplNames;
-                if (aValues.getLength())
+                if (aValues.hasElements())
                     aSvcImplNames = GetLangSvcList( aValues.getConstArray()[0] );
 
                 LanguageType nLang = LANGUAGE_NONE;
@@ -822,7 +822,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pNames[0] = aGrammarCheckerList + "/" + aKeyText;
                 aValues = /*aCfg.*/GetProperties( aNames );
                 uno::Sequence< OUString > aSvcImplNames;
-                if (aValues.getLength())
+                if (aValues.hasElements())
                     aSvcImplNames = GetLangSvc( aValues.getConstArray()[0] );
 
                 LanguageType nLang = LANGUAGE_NONE;
@@ -848,7 +848,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pNames[0] = aHyphenatorList + "/" + aKeyText;
                 aValues = /*aCfg.*/GetProperties( aNames );
                 uno::Sequence< OUString > aSvcImplNames;
-                if (aValues.getLength())
+                if (aValues.hasElements())
                     aSvcImplNames = GetLangSvc( aValues.getConstArray()[0] );
 
                 LanguageType nLang = LANGUAGE_NONE;
@@ -871,7 +871,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames )
                 pNames[0] = aThesaurusList + "/" + aKeyText;
                 aValues = /*aCfg.*/GetProperties( aNames );
                 uno::Sequence< OUString > aSvcImplNames;
-                if (aValues.getLength())
+                if (aValues.hasElements())
                     aSvcImplNames = GetLangSvcList( aValues.getConstArray()[0] );
 
                 LanguageType nLang = LANGUAGE_NONE;
@@ -1677,7 +1677,7 @@ bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName )
         aLocales = getAvailableLocales( SN_THESAURUS );
     }
 
-    if (pDsp  &&  aLocales.getLength())
+    if (pDsp  &&  aLocales.hasElements())
     {
         sal_Int32 nLen = aLocales.getLength();
         const lang::Locale *pLocale = aLocales.getConstArray();
@@ -1809,7 +1809,7 @@ uno::Sequence< OUString > SAL_CALL
         {
             pNames[0] = aNode + "/" + aCfgLocale;
             aValues = /*aCfg.*/GetProperties( aNames );
-            if (aValues.getLength())
+            if (aValues.hasElements())
                 aSvcImplNames = GetLangSvcList( aValues.getConstArray()[0] );
         }
     }
@@ -1821,7 +1821,7 @@ uno::Sequence< OUString > SAL_CALL
         {
             pNames[0] = aNode + "/" + aCfgLocale;
             aValues = /*aCfg.*/GetProperties( aNames );
-            if (aValues.getLength())
+            if (aValues.hasElements())
                 aSvcImplNames = GetLangSvc( aValues.getConstArray()[0] );
         }
     }
@@ -1833,7 +1833,7 @@ uno::Sequence< OUString > SAL_CALL
         {
             pNames[0] = aNode + "/" + aCfgLocale;
             aValues = /*aCfg.*/GetProperties( aNames );
-            if (aValues.getLength())
+            if (aValues.hasElements())
                 aSvcImplNames = GetLangSvc( aValues.getConstArray()[0] );
         }
     }
@@ -1845,7 +1845,7 @@ uno::Sequence< OUString > SAL_CALL
         {
             pNames[0] = aNode + "/" + aCfgLocale;
             aValues = /*aCfg.*/GetProperties( aNames );
-            if (aValues.getLength())
+            if (aValues.hasElements())
                 aSvcImplNames = GetLangSvcList( aValues.getConstArray()[0] );
         }
     }
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 522ee43a96e5..ecb8ec723610 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -321,7 +321,7 @@ bool SpellCheckerDispatcher::isValid_Impl(
                         // Add correct words to the cache.
                         // But not those that are correct only because of
                         // the temporary supplied settings.
-                        if (bTmpRes  &&  0 == rProperties.getLength())
+                        if (bTmpRes  &&  !rProperties.hasElements())
                             GetCache().AddWord( aChkWord, nLanguage );
                     }
                 }
@@ -380,7 +380,7 @@ bool SpellCheckerDispatcher::isValid_Impl(
                          // Add correct words to the cache.
                         // But not those that are correct only because of
                         // the temporary supplied settings.
-                        if (bTmpRes  &&  0 == rProperties.getLength())
+                        if (bTmpRes  &&  !rProperties.hasElements())
                             GetCache().AddWord( aChkWord, nLanguage );
                     }
                 }
@@ -486,7 +486,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
                         // Add correct words to the cache.
                         // But not those that are correct only because of
                         // the temporary supplied settings.
-                        if (!xTmpRes.is()  &&  0 == rProperties.getLength())
+                        if (!xTmpRes.is()  &&  !rProperties.hasElements())
                             GetCache().AddWord( aChkWord, nLanguage );
                     }
                 }
@@ -565,7 +565,7 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
                         // Add correct words to the cache.
                         // But not those that are correct only because of
                         // the temporary supplied settings.
-                        if (!xTmpRes.is()  &&  0 == rProperties.getLength())
+                        if (!xTmpRes.is()  &&  !rProperties.hasElements())
                             GetCache().AddWord( aChkWord, nLanguage );
                     }
                 }
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index 77522e0f77cd..810729f704b6 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -139,7 +139,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
         {
             const Reference< XThesaurus > *pRef = pEntry->aSvcRefs.getConstArray();
             while (i <= pEntry->nLastTriedSvcIndex
-                   &&  aMeanings.getLength() == 0)
+                   &&  !aMeanings.hasElements())
             {
                 if (pRef[i].is()  &&  pRef[i]->hasLocale( rLocale ))
                     aMeanings = pRef[i]->queryMeanings( aChkWord, rLocale, rProperties );
@@ -148,7 +148,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
         }
 
         // if still no result instantiate new services and try those
-        if (aMeanings.getLength() == 0
+        if (!aMeanings.hasElements()
             &&  pEntry->nLastTriedSvcIndex < nLen - 1)
         {
             const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
@@ -161,7 +161,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
             Sequence< Any > aArgs(1);
             aArgs.getArray()[0] <<= GetPropSet();
 
-            while (i < nLen  &&  aMeanings.getLength() == 0)
+            while (i < nLen  &&  !aMeanings.hasElements())
             {
                 // create specific service via it's implementation name
                 Reference< XThesaurus > xThes;
@@ -186,7 +186,7 @@ Sequence< Reference< XMeaning > > SAL_CALL
 
             // if language is not supported by any of the services
             // remove it from the list.
-            if (i == nLen  &&  aMeanings.getLength() == 0)
+            if (i == nLen  &&  !aMeanings.hasElements())
             {
                 if (!SvcListHasLanguage( pEntry->aSvcRefs, rLocale ))
                     aSvcMap.erase( nLanguage );
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index b79b0a569b69..ede7b7ac06c3 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -423,7 +423,7 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs )
     {
     }
 
-    if (rArgs.getLength() >= 1)
+    if (rArgs.hasElements())
     {
         Sequence<css::beans::PropertyValue> aSeq;
         rArgs[0] >>= aSeq;
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 59a4f605ab5c..c5ea4b385849 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -321,7 +321,7 @@ Reference< XInputStream > FilterDetect::extractUnencryptedPackage( MediaDescript
                                                 comphelper::DocPasswordRequestType::MS,
                                                 &aDefaultPasswords );
 
-                if( aEncryptionData.getLength() == 0 )
+                if( !aEncryptionData.hasElements() )
                 {
                     rMediaDescriptor[ MediaDescriptor::PROP_ABORTED() ] <<= true;
                 }
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 6e26fa86595a..54f8b9f6ca83 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -595,7 +595,7 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const util::DateTi
 static void
 writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const Sequence< OUString >& aItems )
 {
-    if( aItems.getLength() == 0 )
+    if( !aItems.hasElements() )
         return;
 
     OUStringBuffer sRep;
diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx
index 2e2c8bc3885b..0a9a690031ae 100644
--- a/oox/source/drawingml/chart/chartspaceconverter.cxx
+++ b/oox/source/drawingml/chart/chartspaceconverter.cxx
@@ -84,13 +84,13 @@ static bool lcl_useWorkaroundForNoGapInOOXML( Reference< chart2::XChartDocument
     Reference< chart2::XCoordinateSystemContainer > xCooSysContainer( xDiagram, UNO_QUERY_THROW );
 
     Sequence< Reference< chart2::XCoordinateSystem > > xCooSysSequence( xCooSysContainer->getCoordinateSystems());
-    if ( xCooSysSequence.getLength() == 0 )
+    if ( !xCooSysSequence.hasElements() )
         return false;
 
     Reference< chart2::XChartTypeContainer > xChartTypeContainer( xCooSysSequence[0], UNO_QUERY_THROW );
 
     Sequence< Reference< chart2::XChartType > > xChartTypeSequence( xChartTypeContainer->getChartTypes() );
-    if ( xChartTypeSequence.getLength() == 0 )
+    if ( !xChartTypeSequence.hasElements() )
         return false;
 
     const Reference<chart2::XChartType>& xCT = xChartTypeSequence[0];
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 323831166f59..048fb4610709 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -203,7 +203,7 @@ void CustomShapeProperties::pushToPropSet(
                                         aAdjustmentVal.Name = adjustmentGuide.maName;
                                         aAdjustmentSeq[ nAdjustmentIndex ] = aAdjustmentVal;
                                     }
-                                } else if ( aAdjustmentSeq.getLength() > 0 ) {
+                                } else if ( aAdjustmentSeq.hasElements() ) {
                                     EnhancedCustomShapeAdjustmentValue aAdjustmentVal;
                                     aAdjustmentVal.Value <<= adjustmentGuide.maFormula.toInt32();
                                     aAdjustmentVal.State = PropertyState_DIRECT_VALUE;
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 1003b66e386c..4656c96bc111 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -1291,7 +1291,7 @@ Reference< XShape > const & Shape::createAndInsert(
             Sequence< PropertyValue > aCamera3DEffects = get3DProperties().getCameraAttributes();
             Sequence< PropertyValue > aLightRig3DEffects = get3DProperties().getLightRigAttributes();
             Sequence< PropertyValue > aShape3DEffects = get3DProperties().getShape3DAttributes( rGraphicHelper, nFillPhClr );
-            if( aCamera3DEffects.getLength() > 0 || aLightRig3DEffects.getLength() > 0 || aShape3DEffects.getLength() > 0 )
+            if( aCamera3DEffects.hasElements() || aLightRig3DEffects.hasElements() || aShape3DEffects.hasElements() )
             {
                 uno::Sequence<beans::PropertyValue> a3DEffectsGrabBag = comphelper::InitPropertySequence(
                 {
@@ -1660,8 +1660,8 @@ void Shape::finalizeXShape( XmlFilterBase& rFilter, const Reference< XShapes >&
                     {
                         Reference< chart2::data::XDataReceiver > xDataRec( xChartDoc, UNO_QUERY );
                         Reference< chart2::data::XDataSource > xData( xDataRec->getUsedData(), UNO_QUERY );
-                        if( xData->getDataSequences().getLength() <= 0 || !xData->getDataSequences()[0]->getValues().is() ||
-                                xData->getDataSequences()[0]->getValues()->getData().getLength() <= 0 )
+                        if( !xData->getDataSequences().hasElements() || !xData->getDataSequences()[0]->getValues().is() ||
+                                !xData->getDataSequences()[0]->getValues()->getData().hasElements() )
                         {
                             rFilter.useInternalChartDataTable( true );
                             rFilter.getChartConverter()->convertFromModel( rFilter, aModel, xChartDoc, xExternalPage, mxShape->getPosition(), mxShape->getSize() );
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 6d4dc1efa1b3..95962aa1d656 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1403,7 +1403,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT
     {
         uno::Sequence< sal_Int32 > aBarPositionSequence;
         mAny >>= aBarPositionSequence;
-        if( aBarPositionSequence.getLength() )
+        if( aBarPositionSequence.hasElements() )
         {
             sal_Int32 nGapWidth = aBarPositionSequence[0];
             pFS->singleElement(FSNS(XML_c, XML_gapWidth), XML_val, OString::number(nGapWidth));
@@ -1441,7 +1441,7 @@ void ChartExport::exportBarChart( const Reference< chart2::XChartType >& xChartT
     {
         uno::Sequence< sal_Int32 > aBarPositionSequence;
         mAny >>= aBarPositionSequence;
-        if( aBarPositionSequence.getLength() )
+        if( aBarPositionSequence.hasElements() )
         {
             sal_Int32 nOverlap = aBarPositionSequence[0];
             // Stacked/Percent Bar/Column chart Overlap-workaround
@@ -1564,7 +1564,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart
     std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
     for (auto & splitDataSeries : aSplitDataSeries)
     {
-        if (splitDataSeries.getLength() == 0)
+        if (!splitDataSeries.hasElements())
             continue;
 
         sal_Int32 nTypeId = XML_lineChart;
@@ -1686,7 +1686,7 @@ void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xCh
     bool bExported = false;
     for (auto & splitDataSeries : aSplitDataSeries)
     {
-        if (splitDataSeries.getLength() == 0)
+        if (!splitDataSeries.hasElements())
             continue;
 
         bExported = true;
@@ -2953,7 +2953,7 @@ void writeLabelProperties( const FSHelperPtr& pFS, ChartExport* pChartExport,
         pFS->endElement(FSNS(XML_c, XML_spPr));
     }
 
-    if (aCustomLabelFields.getLength() > 0)
+    if (aCustomLabelFields.hasElements())
         writeCustomLabel(pFS, pChartExport, aCustomLabelFields);
 
     if (rLabelParam.mbExport)
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 7a069945d571..78225dcc532a 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -3235,7 +3235,7 @@ void DrawingML::WriteFill( const Reference< XPropertySet >& xPropSet )
 
 void DrawingML::WriteStyleProperties( sal_Int32 nTokenId, const Sequence< PropertyValue >& aProperties )
 {
-    if( aProperties.getLength() > 0 )
+    if( aProperties.hasElements() )
     {
         OUString sSchemeClr;
         sal_uInt32 nIdx = 0;
@@ -3290,7 +3290,7 @@ void DrawingML::WriteShapeStyle( const Reference< XPropertySet >& xPropSet )
 
 void DrawingML::WriteShapeEffect( const OUString& sName, const Sequence< PropertyValue >& aEffectProps )
 {
-    if( aEffectProps.getLength() == 0 )
+    if( !aEffectProps.hasElements() )
         return;
 
     // assign the proper tag and enable bContainsColor if necessary
@@ -3502,7 +3502,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet )
         }
     }
 
-    if( aEffects.getLength() == 0 )
+    if( !aEffects.hasElements() )
     {
         bool bHasShadow = false;
         if( GetProperty( rXPropSet, "Shadow" ) )
@@ -3615,7 +3615,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
             break;
         }
     }
-    if( aEffectProps.getLength() == 0 && aLightRigProps.getLength() == 0 && aShape3DProps.getLength() == 0 )
+    if( !aEffectProps.hasElements() && !aLightRigProps.hasElements() && !aShape3DProps.hasElements() )
         return;
 
     bool bCameraRotationPresent = false;
@@ -3697,7 +3697,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
 
     mpFS->startElementNS(XML_a, XML_scene3d);
 
-    if( aEffectProps.getLength() > 0 )
+    if( aEffectProps.hasElements() )
     {
         mpFS->startElementNS( XML_a, XML_camera, xCameraAttrList );
         if( bCameraRotationPresent )
@@ -3712,7 +3712,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
         mpFS->singleElementNS(XML_a, XML_camera, XML_prst, "orthographicFront");
     }
 
-    if( aEffectProps.getLength() > 0 )
+    if( aEffectProps.hasElements() )
     {
         mpFS->startElementNS( XML_a, XML_lightRig, xLightAttrList );
         if( bLightRigRotationPresent )
@@ -3729,7 +3729,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
 
     mpFS->endElementNS( XML_a, XML_scene3d );
 
-    if( aShape3DProps.getLength() == 0 )
+    if( !aShape3DProps.hasElements() )
         return;
 
     bool bBevelTPresent = false, bBevelBPresent = false;
@@ -3771,7 +3771,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
         {
             Sequence< PropertyValue > aBevelProps;
             aShape3DProps[i].Value >>= aBevelProps;
-            if ( aBevelProps.getLength() == 0 )
+            if ( !aBevelProps.hasElements() )
                 continue;
 
             sax_fastparser::FastAttributeList *aBevelAttrList = nullptr;
@@ -3818,7 +3818,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
     {
         mpFS->singleElementNS( XML_a, XML_bevelB, xBevelBAttrList );
     }
-    if( aExtrusionColorProps.getLength() > 0 )
+    if( aExtrusionColorProps.hasElements() )
     {
         OUString sSchemeClr;
         ::Color nColor;
@@ -3844,7 +3844,7 @@ void DrawingML::WriteShape3DEffects( const Reference< XPropertySet >& xPropSet )
 
         mpFS->endElementNS( XML_a, XML_extrusionClr );
     }
-    if( aContourColorProps.getLength() > 0 )
+    if( aContourColorProps.hasElements() )
     {
         OUString sSchemeClr;
         ::Color nColor;
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 3cb71aeacf8c..b36ebb26f67f 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -744,7 +744,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape )
                 else if ( rProp.Name == "Handles" )
                 {
                     rProp.Value >>= aHandles;
-                    if ( aHandles.getLength() )
+                    if ( aHandles.hasElements() )
                         bHasHandles = true;
                     if( !bIsDefaultObject )
                         bPredefinedHandlesUsed = false;
diff --git a/oox/source/helper/zipstorage.cxx b/oox/source/helper/zipstorage.cxx
index 0c455bc8948f..2dbf3cdf2700 100644
--- a/oox/source/helper/zipstorage.cxx
+++ b/oox/source/helper/zipstorage.cxx
@@ -114,7 +114,7 @@ void ZipStorage::implGetElementNames( ::std::vector< OUString >& orElementNames
     if( mxStorage.is() ) try
     {
         aNames = mxStorage->getElementNames();
-        if( aNames.getLength() > 0 )
+        if( aNames.hasElements() )
             orElementNames.insert( orElementNames.end(), aNames.begin(), aNames.end() );
     }
     catch (Exception const& e)
diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx
index 92bdca21321a..c53f252554d9 100644
--- a/oox/source/ole/olestorage.cxx
+++ b/oox/source/ole/olestorage.cxx
@@ -287,7 +287,7 @@ void OleStorage::implGetElementNames( ::std::vector< OUString >& orElementNames
     if( mxStorage.is() ) try
     {
         aNames = mxStorage->getElementNames();
-        if( aNames.getLength() > 0 )
+        if( aNames.hasElements() )
             orElementNames.insert( orElementNames.end(), aNames.begin(), aNames.end() );
     }
     catch(const Exception& )
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 213c53efaf49..b9ea32c3ed70 100644
--- a/package/source/xstor/owriteablestream.cxx
+++ b/package/source/xstor/owriteablestream.cxx
@@ -89,7 +89,7 @@ bool PackageEncryptionDatasEqual( const ::comphelper::SequenceAsHashMap& aHash1,
           ++aIter )
     {
         uno::Sequence< sal_Int8 > aKey1;
-        bResult = ( ( aIter->second >>= aKey1 ) && aKey1.getLength() );
+        bResult = ( ( aIter->second >>= aKey1 ) && aKey1.hasElements() );
         if ( bResult )
         {
             uno::Sequence< sal_Int8 > aKey2 = aHash2.getUnpackedValueOrDefault( aIter->first, uno::Sequence< sal_Int8 >() );
@@ -401,7 +401,7 @@ bool OWriteStream_Impl::IsEncrypted()
     // That means that if it is intended to use common storage key
     // it is already has no encryption but is marked to be stored
     // encrypted and the key is empty.
-    if ( !bWasEncr && bToBeEncr && !aKey.getLength() )
+    if ( !bWasEncr && bToBeEncr && !aKey.hasElements() )
     {
         // the stream is intended to use common storage password
         m_bUseCommonEncryption = true;
@@ -926,7 +926,7 @@ void OWriteStream_Impl::Revert()
 
 uno::Sequence< beans::PropertyValue > const & OWriteStream_Impl::GetStreamProperties()
 {
-    if ( !m_aProps.getLength() )
+    if ( !m_aProps.hasElements() )
         m_aProps = ReadPackageStreamProperties();
 
     return m_aProps;
@@ -1551,7 +1551,7 @@ void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStora
 
             if ( m_nRelInfoStatus == RELINFO_CHANGED )
             {
-                if ( m_aNewRelInfo.getLength() )
+                if ( m_aNewRelInfo.hasElements() )
                 {
                     uno::Reference< io::XStream > xRelsStream =
                         xRelStorage->openStreamElement( aNewRelStreamName,
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 95233f787b45..b10e4fafa5ef 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -5518,7 +5518,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted
     if ( aStreamPath.isEmpty() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, true ) )
         throw lang::IllegalArgumentException( THROW_WHERE "Unexpected entry name syntax.", uno::Reference< uno::XInterface >(), 1 );
 
-    if ( !aEncryptionData.getLength() )
+    if ( !aEncryptionData.hasElements() )
         throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 3 );
 
     if ( !( m_pImpl->m_nStorageMode & embed::ElementModes::WRITE )
diff --git a/package/source/zipapi/XBufferedThreadedStream.cxx b/package/source/zipapi/XBufferedThreadedStream.cxx
index e40613d4b66e..6bc7da7fa173 100644
--- a/package/source/zipapi/XBufferedThreadedStream.cxx
+++ b/package/source/zipapi/XBufferedThreadedStream.cxx
@@ -143,7 +143,7 @@ sal_Int32 SAL_CALL XBufferedThreadedStream::readBytes( Sequence< sal_Int8 >& rDa
     while( nPendingBytes )
     {
         const Buffer &pBuffer = getNextBlock();
-        if( pBuffer.getLength() <= 0 )
+        if( !pBuffer.hasElements() )
         {
             rData.realloc( nAvailableSize - nPendingBytes );
             return nAvailableSize - nPendingBytes;
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 8c0b97d1367b..82b6981f4378 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -81,10 +81,10 @@ XUnbufferedStream::XUnbufferedStream(
     if (mnZipSize < 0)
         throw ZipIOException("The stream seems to be broken!");
 
-    bool bHaveEncryptData = rData.is() && rData->m_aInitVector.getLength() &&
-        ((rData->m_aSalt.getLength() && rData->m_nIterationCount != 0)
+    bool bHaveEncryptData = rData.is() && rData->m_aInitVector.hasElements() &&
+        ((rData->m_aSalt.hasElements() && rData->m_nIterationCount != 0)
          ||
-         rData->m_aKey.getLength());
+         rData->m_aKey.hasElements());
     bool bMustDecrypt = nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted;
 
     if ( bMustDecrypt )
@@ -268,7 +268,7 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
                     if ( mnZipCurrent == mnZipEnd )
                     {
                         uno::Sequence< sal_Int8 > aSuffix = m_xCipherContext->finalizeCipherContextAndDispose();
-                        if ( aSuffix.getLength() )
+                        if ( aSuffix.hasElements() )
                         {
                             sal_Int32 nOldLen = maCompBuffer.getLength();
                             maCompBuffer.realloc( nOldLen + aSuffix.getLength() );
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index f37f38c03e62..af90d6b1ef1a 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -397,7 +397,7 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const rtl::R
     if ( !rData.is() )
         throw ZipIOException("Encrypted stream without encryption data!" );
 
-    if ( !rData->m_aKey.getLength() )
+    if ( !rData->m_aKey.hasElements() )
         throw packages::WrongPasswordException(THROW_WHERE );
 
     uno::Reference< XSeekable > xSeek( xStream, UNO_QUERY );
@@ -406,8 +406,8 @@ uno::Reference< XInputStream > ZipFile::StaticGetDataFromRawStream( const rtl::R
 
     // if we have a digest, then this file is an encrypted one and we should
     // check if we can decrypt it or not
-    OSL_ENSURE( rData->m_aDigest.getLength(), "Can't detect password correctness without digest!" );
-    if ( rData->m_aDigest.getLength() )
+    OSL_ENSURE( rData->m_aDigest.hasElements(), "Can't detect password correctness without digest!" );
+    if ( rData->m_aDigest.hasElements() )
     {
         sal_Int32 nSize = sal::static_int_cast< sal_Int32 >( xSeek->getLength() );
         if ( nSize > n_ConstDigestLength + 32 )
@@ -446,7 +446,7 @@ void CheckSequence( const uno::Sequence< sal_Int8 >& aSequence )
 
 bool ZipFile::StaticHasValidPassword( const uno::Reference< uno::XComponentContext >& rxContext, const Sequence< sal_Int8 > &aReadBuffer, const ::rtl::Reference< EncryptionData > &rData )
 {
-    if ( !rData.is() || !rData->m_aKey.getLength() )
+    if ( !rData.is() || !rData->m_aKey.hasElements() )
         return false;
 
     bool bRet = false;
@@ -466,7 +466,7 @@ bool ZipFile::StaticHasValidPassword( const uno::Reference< uno::XComponentConte
         // it is no problem, actually this is why we read 32 additional bytes ( two of maximal possible encryption blocks )
     }
 
-    if ( aDecryptBuffer2.getLength() )
+    if ( aDecryptBuffer2.hasElements() )
     {
         sal_Int32 nOldLen = aDecryptBuffer.getLength();
         aDecryptBuffer.realloc( nOldLen + aDecryptBuffer2.getLength() );
@@ -483,7 +483,7 @@ bool ZipFile::StaticHasValidPassword( const uno::Reference< uno::XComponentConte
     aDigestSeq = xDigestContext->finalizeDigestAndDispose();
 
     // If we don't have a digest, then we have to assume that the password is correct
-    if (  rData->m_aDigest.getLength() != 0  &&
+    if (  rData->m_aDigest.hasElements() &&
           ( aDigestSeq.getLength() != rData->m_aDigest.getLength() ||
             0 != memcmp ( aDigestSeq.getConstArray(),
                                      rData->m_aDigest.getConstArray(),
@@ -502,7 +502,7 @@ bool ZipFile::hasValidPassword ( ZipEntry const & rEntry, const ::rtl::Reference
     ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() );
 
     bool bRet = false;
-    if ( rData.is() && rData->m_aKey.getLength() )
+    if ( rData.is() && rData->m_aKey.hasElements() )
     {
         css::uno::Reference < css::io::XSeekable > xSeek(xStream, UNO_QUERY_THROW);
         xSeek->seek( rEntry.nOffset );
@@ -667,7 +667,7 @@ uno::Reference< XInputStream > ZipFile::getInputStream( ZipEntry& rEntry,
 
     // if we have a digest, then this file is an encrypted one and we should
     // check if we can decrypt it or not
-    if ( bIsEncrypted && rData.is() && rData->m_aDigest.getLength() )
+    if ( bIsEncrypted && rData.is() && rData->m_aDigest.hasElements() )
         bNeedRawStream = !hasValidPassword ( rEntry, rData );
 
     return createStreamForZipEntry ( aMutexHolder,
@@ -699,8 +699,8 @@ uno::Reference< XInputStream > ZipFile::getDataStream( ZipEntry& rEntry,
 
         // if we have a digest, then this file is an encrypted one and we should
         // check if we can decrypt it or not
-        OSL_ENSURE( rData->m_aDigest.getLength(), "Can't detect password correctness without digest!" );
-        if ( rData->m_aDigest.getLength() && !hasValidPassword ( rEntry, rData ) )
+        OSL_ENSURE( rData->m_aDigest.hasElements(), "Can't detect password correctness without digest!" );
+        if ( rData->m_aDigest.hasElements() && !hasValidPassword ( rEntry, rData ) )
                 throw packages::WrongPasswordException(THROW_WHERE );
     }
     else
diff --git a/package/source/zipapi/ZipOutputEntry.cxx b/package/source/zipapi/ZipOutputEntry.cxx
index 3fa6e2792752..2b1447bd3246 100644
--- a/package/source/zipapi/ZipOutputEntry.cxx
+++ b/package/source/zipapi/ZipOutputEntry.cxx
@@ -229,7 +229,7 @@ void ZipOutputEntry::doDeflate()
     {
         // FIXME64: sequence not 64bit safe.
         uno::Sequence< sal_Int8 > aEncryptionBuffer = m_xCipherContext->finalizeCipherContextAndDispose();
-        if ( aEncryptionBuffer.getLength() )
+        if ( aEncryptionBuffer.hasElements() )
         {
             m_xOutStream->writeBytes( aEncryptionBuffer );
 
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 );
         }
diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx
index c42fdef45ac8..1aaaedcd3d89 100644
--- a/package/source/zippackage/ZipPackageFolder.cxx
+++ b/package/source/zippackage/ZipPackageFolder.cxx
@@ -273,7 +273,7 @@ bool ZipPackageFolder::saveChild(
     saveContents( sTempName, rManList, rZipOut, rEncryptionKey, nPBKDF2IterationCount, rRandomPool);
 
     // folder can have a mediatype only in package format
-    if ( aPropSet.getLength() && ( m_nFormat == embed::StorageFormats::PACKAGE ) )
+    if ( aPropSet.hasElements() && ( m_nFormat == embed::StorageFormats::PACKAGE ) )
         rManList.push_back( aPropSet );
 
     return true;
diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx
index 3d6f5b432986..db58a2892c33 100644
--- a/package/source/zippackage/ZipPackageStream.cxx
+++ b/package/source/zippackage/ZipPackageStream.cxx
@@ -220,7 +220,7 @@ uno::Sequence<sal_Int8> ZipPackageStream::GetEncryptionKey(Bugs const bugs)
     sal_Int32 nKeyGenID = GetStartKeyGenID();
     bool const bUseWinEncoding = (bugs == Bugs::WinEncodingWrongSHA1 || m_bUseWinEncoding);
 
-    if ( m_bHaveOwnKey && m_aStorageEncryptionKeys.getLength() )
+    if ( m_bHaveOwnKey && m_aStorageEncryptionKeys.hasElements() )
     {
         OUString aNameToFind;
         if ( nKeyGenID == xml::crypto::DigestID::SHA256 )
@@ -242,13 +242,13 @@ uno::Sequence<sal_Int8> ZipPackageStream::GetEncryptionKey(Bugs const bugs)
 
         // 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
         aResult = m_aEncryptionKey;
 
-    if ( !aResult.getLength() || !m_bHaveOwnKey )
+    if ( !aResult.hasElements() || !m_bHaveOwnKey )
         aResult = m_rZipPackage.GetEncryptionKey();
 
     return aResult;
@@ -271,7 +271,7 @@ uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream(
     if ( m_bToBeEncrypted )
     {
         aKey = GetEncryptionKey();
-        if ( !aKey.getLength() )
+        if ( !aKey.hasElements() )
             throw packages::NoEncryptionException(THROW_WHERE );
     }
 
@@ -538,7 +538,7 @@ bool ZipPackageStream::saveChild(
     pTempEntry->sPath = rPath;
     pTempEntry->nPathLen = static_cast<sal_Int16>( OUStringToOString( pTempEntry->sPath, RTL_TEXTENCODING_UTF8 ).getLength() );
 
-    const bool bToBeEncrypted = m_bToBeEncrypted && (rEncryptionKey.getLength() || m_bHaveOwnKey);
+    const bool bToBeEncrypted = m_bToBeEncrypted && (rEncryptionKey.hasElements() || m_bHaveOwnKey);
     const bool bToBeCompressed = bToBeEncrypted || m_bToBeCompressed;
 
     aPropSet[PKG_MNFST_MEDIATYPE].Name = sMediaTypeProperty;
@@ -880,7 +880,7 @@ bool ZipPackageStream::saveChild(
     if (bSuccess && !bParallelDeflate)
         successfullyWritten(pTempEntry);
 
-    if ( aPropSet.getLength()
+    if ( aPropSet.hasElements()
       && ( m_nFormat == embed::StorageFormats::PACKAGE || m_nFormat == embed::StorageFormats::OFOPXML ) )
         rManList.push_back( aPropSet );
 
@@ -1243,7 +1243,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
             aNewKey = aSequence;
         }
 
-        if ( aNewKey.getLength() )
+        if ( aNewKey.hasElements() )
         {
             if ( !m_xBaseEncryptionData.is() )
                 m_xBaseEncryptionData = new BaseEncryptionData;
@@ -1275,7 +1275,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName,
                                                 2 );
         }
 
-        if ( aKeys.getLength() )
+        if ( aKeys.hasElements() )
         {
             if ( !m_xBaseEncryptionData.is() )
                 m_xBaseEncryptionData = new BaseEncryptionData;
diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx
index 01252838e110..45079fdbaec3 100644
--- a/package/source/zippackage/zipfileaccess.cxx
+++ b/package/source/zippackage/zipfileaccess.cxx
@@ -173,7 +173,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu
     if ( m_pZipFile )
         throw uno::RuntimeException(THROW_WHERE ); // initialization is allowed only one time
 
-    if ( !aArguments.getLength() )
+    if ( !aArguments.hasElements() )
         throw lang::IllegalArgumentException(THROW_WHERE, uno::Reference< uno::XInterface >(), 1 );
 
     OSL_ENSURE( aArguments.getLength() == 1, "Too many arguments are provided, only the first one will be used!" );
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index 7a74d98eaf4e..f434b9ec2aed 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -266,7 +266,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
                 // I can only decide for one solution by checking the method signature,
                 // so I need the reflection of the adapter !
                 aOutParamIndex = getOutIndexes( aFunctionName );
-                if( aOutParamIndex.getLength() )
+                if( aOutParamIndex.hasElements() )
                 {
                     // out parameters exist, extract the sequence
                     Sequence< Any  > seq;
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index dc2f6f6ba06c..67f74d58458f 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -1133,7 +1133,7 @@ void OReportDefinition::fillArgs(utl::MediaDescriptor& _aDescriptor)
 {
     uno::Sequence<beans::PropertyValue> aComponentData;
     aComponentData = _aDescriptor.getUnpackedValueOrDefault("ComponentData",aComponentData);
-    if ( aComponentData.getLength() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) )
+    if ( aComponentData.hasElements() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) )
     {
         ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData );
         m_pImpl->m_xActiveConnection = aComponentDataMap.getUnpackedValueOrDefault("ActiveConnection",m_pImpl->m_xActiveConnection);
diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx
index a844ae79f149..df7b9b2444a4 100644
--- a/reportdesign/source/filter/xml/xmlControlProperty.cxx
+++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx
@@ -151,7 +151,7 @@ void OXMLControlProperty::EndElement()
 {
     if ( !m_aSetting.Name.isEmpty() && m_xControl.is() )
     {
-        if ( m_bIsList && !m_aSequence.getLength() )
+        if ( m_bIsList && !m_aSequence.hasElements() )
             m_aSetting.Value <<= m_aSequence;
         try
         {
diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx
index a907b3c237c1..2139827e4d13 100644
--- a/reportdesign/source/filter/xml/xmlExport.cxx
+++ b/reportdesign/source/filter/xml/xmlExport.cxx
@@ -347,7 +347,7 @@ void ORptExport::exportFunction(const uno::Reference< XFunction>& _xFunction)
 void ORptExport::exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponet)
 {
     const uno::Sequence< OUString> aMasterFields = _xReportComponet->getMasterFields();
-    if ( aMasterFields.getLength() )
+    if ( aMasterFields.hasElements() )
     {
         SvXMLElementExport aElement(*this,XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS, true, true);
         const uno::Sequence< OUString> aDetailFields = _xReportComponet->getDetailFields();
diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx
index 980f8f26d077..a3017a6a7069 100644
--- a/reportdesign/source/ui/dlg/GroupExchange.cxx
+++ b/reportdesign/source/ui/dlg/GroupExchange.cxx
@@ -43,7 +43,7 @@ namespace rptui
 
     void OGroupExchange::AddSupportedFormats()
     {
-        if ( m_aGroupRow.getLength() )
+        if ( m_aGroupRow.hasElements() )
         {
             AddFormat(OGroupExchange::getReportGroupId());
         }
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index a12479660ad5..d761e50655d3 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -260,7 +260,7 @@ void OFieldExpressionControl::StartDrag( sal_Int8 /*_nAction*/ , const Point& /*
     {
         uno::Sequence<uno::Any> aClipboardList = fillSelectedGroups();
 
-        if( aClipboardList.getLength() )
+        if( aClipboardList.hasElements() )
         {
             rtl::Reference<OGroupExchange> pData = new OGroupExchange(aClipboardList);
             pData->StartDrag(this, DND_ACTION_MOVE );
@@ -297,7 +297,7 @@ sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rE
         uno::Any aDrop = aDropped.GetAny(OGroupExchange::getReportGroupId(), OUString());
         uno::Sequence< uno::Any > aGroups;
         aDrop >>= aGroups;
-        if ( aGroups.getLength() )
+        if ( aGroups.hasElements() )
         {
             moveGroups(aGroups,nRow);
             nAction = DND_ACTION_MOVE;
@@ -308,7 +308,7 @@ sal_Int8 OFieldExpressionControl::ExecuteDrop( const BrowserExecuteDropEvent& rE
 
 void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,bool _bSelect)
 {
-    if ( _aGroups.getLength() )
+    if ( _aGroups.hasElements() )
     {
         m_bIgnoreEvent = true;
         {
@@ -1026,7 +1026,7 @@ IMPL_LINK_NOARG( OGroupsSortingDialog, OnFormatAction, ToolBox*, void )
         }
         else
         {
-            if ( nIndex >= 0 && aClipboardList.getLength() )
+            if ( nIndex >= 0 && aClipboardList.hasElements() )
             {
                 m_pFieldExpression->SetNoSelection();
                 m_pFieldExpression->moveGroups(aClipboardList,nIndex,false);
diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx
index cf72819673b7..6dd851e5bd0c 100644
--- a/reportdesign/source/ui/dlg/Navigator.cxx
+++ b/reportdesign/source/ui/dlg/Navigator.cxx
@@ -488,7 +488,7 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent )
     uno::Any aSec = xSelectionSupplier->getSelection();
     uno::Sequence< uno::Reference< report::XReportComponent > > aSelection;
     aSec >>= aSelection;
-    if ( !aSelection.getLength() )
+    if ( !aSelection.hasElements() )
     {
         uno::Reference< uno::XInterface> xSelection(aSec,uno::UNO_QUERY);
         SvTreeListEntry* pEntry = find(xSelection);
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index e1ba098803d5..315061709c5e 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -224,7 +224,7 @@ static void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs,
                                  ::std::vector< uno::Reference< uno::XInterface > >& _rControlsFormats)
 {
     uno::Reference< report::XReportControlFormat> xReportControlFormat;
-    if ( aArgs.getLength() )
+    if ( aArgs.hasElements() )
     {
         SequenceAsHashMap aMap(aArgs);
         xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>());
@@ -1522,10 +1522,10 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
                         if ( !xFormat.is() )
                             continue;
 
-                        if ( aSettings.getLength() == 0 )
+                        if ( !aSettings.hasElements() )
                         {
                             ::rptui::openCharDialog( xFormat, xWindow, aSettings );
-                            if ( aSettings.getLength() == 0 )
+                            if ( !aSettings.hasElements() )
                                 break;
                         }
 
@@ -1554,7 +1554,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
         case SID_DATETIME:
             if ( m_xReportDefinition.is() )
             {
-                if ( !aArgs.getLength() )
+                if ( !aArgs.hasElements() )
                 {
                     ODateTimeDialog aDlg(getFrameWeld(), getDesignView()->getCurrentSection(), this);
                     aDlg.run();
@@ -1566,7 +1566,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
         case SID_INSERT_FLD_PGNUMBER:
             if ( m_xReportDefinition.is() )
             {
-                if ( !aArgs.getLength() )
+                if ( !aArgs.hasElements() )
                 {
                     OPageNumberDialog aDlg(getFrameWeld(), m_xReportDefinition, this);
                     aDlg.run();
@@ -1590,7 +1590,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
         case SID_GROUP:
             break;
         case SID_ATTR_ZOOM:
-            if ( aArgs.getLength() == 0 )
+            if ( !aArgs.hasElements() )
             {
                 openZoomDialog();
             }
@@ -1722,7 +1722,7 @@ IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow& ,_rAddFieldDlg, void
     WaitObject aObj( getDesignView() );
     uno::Sequence< beans::PropertyValue > aArgs = _rAddFieldDlg.getSelectedFieldDescriptors();
     // we use this way to create undo actions
-    if ( aArgs.getLength() )
+    if ( aArgs.hasElements() )
     {
         executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
     }
@@ -3019,7 +3019,7 @@ sal_Bool SAL_CALL OReportController::select( const Any& aSelection )
         uno::Sequence< uno::Reference<report::XReportComponent> > aElements;
         if ( aSelection >>= aElements )
         {
-            if ( aElements.getLength() > 0 )
+            if ( aElements.hasElements() )
                 getDesignView()->showProperties(uno::Reference<uno::XInterface>(aElements[0],uno::UNO_QUERY));
             getDesignView()->setMarked(aElements, true);
         }
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 73de1d115c24..d064f485f328 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -234,7 +234,7 @@ void OReportSection::fill()
 void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce)
 {
     OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!");
-    if ( m_xSection.is() && _aAllreadyCopiedObjects.getLength() )
+    if ( m_xSection.is() && _aAllreadyCopiedObjects.hasElements() )
     {
         // stop all drawing actions
         m_pView->BrkAction();
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 19bc83444787..6204f2808d8e 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1212,7 +1212,7 @@ void OViewsWindow::EndDragObj(bool _bControlKeyPressed, const OSectionView* _pSe
                 pInSection->EndDragObj();
         }
 
-        if ( aAllreadyCopiedObjects.getLength() )
+        if ( aAllreadyCopiedObjects.hasElements() )
         {
             try
             {
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index 701be41e183c..633d5faea46a 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -328,7 +328,7 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface>
 OUString PropBrw::GetHeadlineName( const uno::Sequence< Reference<uno::XInterface> >& _aObjects )
 {
     OUString aName;
-    if ( !_aObjects.getLength() )
+    if ( !_aObjects.hasElements() )
     {
         aName = RptResId(RID_STR_BRWTITLE_NO_PROPERTIES);
     }
@@ -510,7 +510,7 @@ void PropBrw::Update( OSectionView* pNewView )
             }
         }
 
-        if ( aMarkedObjects.getLength() ) // multiple selection
+        if ( aMarkedObjects.hasElements() ) // multiple selection
         {
             m_xLastSection.clear();
             implSetNewObject( aMarkedObjects );


More information about the Libreoffice-commits mailing list