summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-12-21 20:21:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-22 07:43:22 +0100
commit968b64d054eb164cee9fb92b6bf7dd93f478bf24 (patch)
tree80d92181e4796cf77b37b1faa03a3ccf106aef22 /linguistic
parent1d21a51d814b39711cb1cc7f925b0c620b42eaa7 (diff)
loplugin:flatten in l10ntools..lotuswordpro
Change-Id: Ie6de142db1987094fdf538148ac5ee33379a3e4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127275 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/misc.cxx33
1 files changed, 16 insertions, 17 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index 09635359d1ce..0954c093238a 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -568,26 +568,25 @@ bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, LanguageTyp
CapType capitalType(const OUString& aTerm, CharClass const * pCC)
{
sal_Int32 tlen = aTerm.getLength();
- if (pCC && tlen)
+ if (!pCC || !tlen)
+ return CapType::UNKNOWN;
+
+ sal_Int32 nc = 0;
+ for (sal_Int32 tindex = 0; tindex < tlen; ++tindex)
{
- sal_Int32 nc = 0;
- for (sal_Int32 tindex = 0; tindex < tlen; ++tindex)
- {
- if (pCC->getCharacterType(aTerm,tindex) &
- css::i18n::KCharacterType::UPPER) nc++;
- }
+ if (pCC->getCharacterType(aTerm,tindex) &
+ css::i18n::KCharacterType::UPPER) nc++;
+ }
- if (nc == 0)
- return CapType::NOCAP;
- if (nc == tlen)
- return CapType::ALLCAP;
- if ((nc == 1) && (pCC->getCharacterType(aTerm,0) &
- css::i18n::KCharacterType::UPPER))
- return CapType::INITCAP;
+ if (nc == 0)
+ return CapType::NOCAP;
+ if (nc == tlen)
+ return CapType::ALLCAP;
+ if ((nc == 1) && (pCC->getCharacterType(aTerm,0) &
+ css::i18n::KCharacterType::UPPER))
+ return CapType::INITCAP;
- return CapType::MIXED;
- }
- return CapType::UNKNOWN;
+ return CapType::MIXED;
}
// sorted(!) array of unicode ranges for code points that are exclusively(!) used as numbers