summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-04 17:06:38 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-31 16:10:17 +0200
commit966f40eecfc60f20c309bc2477149442d753763a (patch)
treeed72f7b3d2fe609696834d47da120eeb4bd1460c /i18npool
parent4830a1bae89a8ed60696503e315ffd42c70dff74 (diff)
Use hasElements to check Sequence emptiness in [e-i]*
Similar to clang-tidy readability-container-size-empty Change-Id: I79e31919db8f4132216f09a7868d18835eeb154b Reviewed-on: https://gerrit.libreoffice.org/71795 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/indexentry/indexentrysupplier.cxx2
-rw-r--r--i18npool/source/indexentry/indexentrysupplier_default.cxx4
-rw-r--r--i18npool/source/localedata/localedata.cxx2
-rw-r--r--i18npool/source/textconversion/textconversion_zh.cxx10
4 files changed, 9 insertions, 9 deletions
diff --git a/i18npool/source/indexentry/indexentrysupplier.cxx b/i18npool/source/indexentry/indexentrysupplier.cxx
index 5bf55607ab5d..3660c89e6e46 100644
--- a/i18npool/source/indexentry/indexentrysupplier.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier.cxx
@@ -166,7 +166,7 @@ OUString SAL_CALL IndexEntrySupplier::getIndexFollowPageWord( sal_Bool bMorePage
Sequence< OUString > aFollowPageWords = LocaleDataImpl::get()->getFollowPageWords(rLocale);
return (bMorePages && aFollowPageWords.getLength() > 1) ?
- aFollowPageWords[1] : (aFollowPageWords.getLength() > 0 ?
+ aFollowPageWords[1] : (aFollowPageWords.hasElements() ?
aFollowPageWords[0] : OUString());
}
diff --git a/i18npool/source/indexentry/indexentrysupplier_default.cxx b/i18npool/source/indexentry/indexentrysupplier_default.cxx
index 2dc123822e07..186f3a511f59 100644
--- a/i18npool/source/indexentry/indexentrysupplier_default.cxx
+++ b/i18npool/source/indexentry/indexentrysupplier_default.cxx
@@ -258,9 +258,9 @@ void Index::init(const lang::Locale &rLocale, const OUString& algorithm)
Sequence< UnicodeScript > scriptList = LocaleDataImpl::get()->getUnicodeScripts( rLocale );
- if (scriptList.getLength() == 0) {
+ if (!scriptList.hasElements()) {
scriptList = LocaleDataImpl::get()->getUnicodeScripts(LOCALE_EN);
- if (scriptList.getLength() == 0)
+ if (!scriptList.hasElements())
throw RuntimeException();
}
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index 454c4045ddef..91808eebdb77 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -673,7 +673,7 @@ Sequence< CalendarItem2 > &LocaleDataImpl::getCalendarItemByName(const OUString&
// Referred locale not found, return name for en_US locale.
if (index == cals.getLength()) {
cals = getAllCalendars2( Locale("en", "US", OUString()) );
- if (cals.getLength() <= 0)
+ if (!cals.hasElements())
throw RuntimeException();
ref_cal = cals[0];
}
diff --git a/i18npool/source/textconversion/textconversion_zh.cxx b/i18npool/source/textconversion/textconversion_zh.cxx
index c9ca672edd3d..3f7ff96d8a15 100644
--- a/i18npool/source/textconversion/textconversion_zh.cxx
+++ b/i18npool/source/textconversion/textconversion_zh.cxx
@@ -193,8 +193,8 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
// catch all other exceptions to allow
// querying the system dictionary in the next line
}
- if (conversions.getLength() > 0) {
- if (offset.getLength() > 0) {
+ if (conversions.hasElements()) {
+ if (offset.hasElements()) {
if (word.getLength() != conversions[0].getLength())
one2one=false;
while (current < conversions[0].getLength()) {
@@ -229,7 +229,7 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
else // Simplified/Traditionary conversion, forwards search for next word
current = entry[current] + word.getLength() + 1;
sal_Int32 start=current;
- if (offset.getLength() > 0) {
+ if (offset.hasElements()) {
if (word.getLength() != OUString(&wordData[current]).getLength())
one2one=false;
sal_Int32 convertedLength=OUString(&wordData[current]).getLength();
@@ -250,14 +250,14 @@ TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos,
}
}
if (!found) {
- if (offset.getLength() > 0)
+ if (offset.hasElements())
offset[count]=nStartPos+currPos;
newStr[count++] =
getOneCharConversion(aText[nStartPos+currPos], charData, charIndex);
currPos++;
}
}
- if (offset.getLength() > 0)
+ if (offset.hasElements())
offset.realloc(one2one ? 0 : count);
OUString aRet(newStr.get(), count);
return aRet;