summaryrefslogtreecommitdiff
path: root/i18npool
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 09:04:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-15 19:25:23 +0200
commit4cc702a7055c0e12c7cbf5e5e359e7cbc8b88020 (patch)
treef09f7167cdca22f16edb5a998c2f9714e4bdc698 /i18npool
parent393aa2b3dee9cca84a215635060b369a962ab179 (diff)
loplugin:buriedassign in f,h,i*
Change-Id: Iac753e528e13cb2565832a484e87f88061bbc91e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92239 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/source/breakiterator/breakiteratorImpl.cxx55
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx16
2 files changed, 55 insertions, 16 deletions
diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx
index 30a2d9105459..a6ce162270ef 100644
--- a/i18npool/source/breakiterator/breakiteratorImpl.cxx
+++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx
@@ -75,23 +75,57 @@ static sal_Int32 skipSpace(const OUString& Text, sal_Int32 nPos, sal_Int32 len,
switch (rWordType) {
case WordType::ANYWORD_IGNOREWHITESPACES:
if (bDirection)
- while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos)) || isZWSP(ch))) nPos=pos;
+ while (nPos < len)
+ {
+ ch = Text.iterateCodePoints(&pos);
+ if (!u_isWhitespace(ch) && !isZWSP(ch))
+ break;
+ nPos = pos;
+ }
else
- while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch))) nPos=pos;
+ while (nPos > 0)
+ {
+ ch = Text.iterateCodePoints(&pos, -1);
+ if (!u_isWhitespace(ch) && !isZWSP(ch))
+ break;
+ nPos = pos;
+ }
break;
case WordType::DICTIONARY_WORD:
if (bDirection)
- while (nPos < len && (u_isWhitespace(ch = Text.iterateCodePoints(&pos)) || isZWSP(ch) ||
- ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos;
+ while (nPos < len)
+ {
+ ch = Text.iterateCodePoints(&pos);
+ if (!u_isWhitespace(ch) && !isZWSP(ch) && (ch == 0x002E || u_isalnum(ch)))
+ break;
+ nPos = pos;
+ }
else
- while (nPos > 0 && (u_isWhitespace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch) ||
- ! (ch == 0x002E || u_isalnum(ch)))) nPos=pos;
+ while (nPos > 0)
+ {
+ ch = Text.iterateCodePoints(&pos, -1);
+ if (!u_isWhitespace(ch) && !isZWSP(ch) && (ch == 0x002E || u_isalnum(ch)))
+ break;
+ nPos = pos;
+ }
break;
case WordType::WORD_COUNT:
if (bDirection)
- while (nPos < len && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos)) || isZWSP(ch))) nPos=pos;
+ while (nPos < len)
+ {
+ ch = Text.iterateCodePoints(&pos);
+ if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
+ break;
+ nPos = pos;
+ }
else
- while (nPos > 0 && (u_isUWhiteSpace(ch = Text.iterateCodePoints(&pos, -1)) || isZWSP(ch))) nPos=pos;
+ while (nPos > 0)
+ {
+ ch = Text.iterateCodePoints(&pos, -1);
+ if (!u_isUWhiteSpace(ch) && !isZWSP(ch))
+ break;
+ nPos = pos;
+ }
break;
}
return nPos;
@@ -578,7 +612,10 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale)
for (const lookupTableItem& listItem : lookupTable) {
if (rLocale == listItem.aLocale)
- return xBI = listItem.xBI;
+ {
+ xBI = listItem.xBI;
+ return xBI;
+ }
}
OUStringLiteral under("_");
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 38c0bce2055d..dd23465bea19 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -688,14 +688,16 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
case cssi::NumberFormatIndex::CURRENCY_1000DEC2 :
// Remember the currency symbol if present.
{
- sal_Int32 nStart;
- if (sTheCompatibleCurrency.isEmpty() &&
- ((nStart = n->getValue().indexOf("[$")) >= 0))
+ if (sTheCompatibleCurrency.isEmpty())
{
- const OUString& aCode( n->getValue());
- sal_Int32 nHyphen = aCode.indexOf( '-', nStart);
- if (nHyphen >= nStart + 3)
- sTheCompatibleCurrency = aCode.copy( nStart + 2, nHyphen - nStart - 2);
+ sal_Int32 nStart = n->getValue().indexOf("[$");
+ if (nStart >= 0)
+ {
+ const OUString& aCode( n->getValue());
+ sal_Int32 nHyphen = aCode.indexOf( '-', nStart);
+ if (nHyphen >= nStart + 3)
+ sTheCompatibleCurrency = aCode.copy( nStart + 2, nHyphen - nStart - 2);
+ }
}
}
[[fallthrough]];