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/thesaurus/libnth/nthesimp.cxx | |
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/thesaurus/libnth/nthesimp.cxx')
-rw-r--r-- | lingucomponent/source/thesaurus/libnth/nthesimp.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
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]; |