diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-03 22:11:02 +0300 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-05-17 11:20:15 +0200 |
commit | 0e4c542f7a862e681baf25f042bc3a928c14004f (patch) | |
tree | 56582ddb40671a22eaaa54e1ab3058dc553b9d5d /lingucomponent/source | |
parent | 644ca26af744aec1e66c8dd4199d1228e0f780be (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 'lingucomponent/source')
-rw-r--r-- | lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 6 | ||||
-rw-r--r-- | lingucomponent/source/spellcheck/spell/sspellimp.cxx | 6 | ||||
-rw-r--r-- | lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 14 |
3 files changed, 13 insertions, 13 deletions
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]; |