summaryrefslogtreecommitdiff
path: root/lingucomponent
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-11 15:49:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-12 18:16:28 +0200
commit6e2a017049c4a91632d69ffd02e63138616adda0 (patch)
tree17f2cf72e3dfddce70d23b97fb833430306e35fc /lingucomponent
parenta4ca3023e22e2435d16e905696e5dad589f3f47d (diff)
coverity#1430057 rework warning code to use nonwarning pattern
Change-Id: I1e41e81a88825a7c91ffb9603eb9d769bd41822a Reviewed-on: https://gerrit.libreoffice.org/54143 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lingucomponent')
-rw-r--r--lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
index ba9523bc78f8..c33c7176c0b3 100644
--- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
+++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx
@@ -263,8 +263,6 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo
sal_Int16 nMaxLeading,
const css::beans::PropertyValues& aProperties )
{
- int k = 0;
-
PropertyHelper_Hyphenation& rHelper = GetPropHelper();
rHelper.SetTmpPropVals(aProperties);
sal_Int16 minTrail = rHelper.GetMinTrailing();
@@ -276,15 +274,15 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo
Reference< XHyphenatedWord > xRes;
- k = -1;
- for (size_t j = 0; j < mvDicts.size(); j++)
+ int k = -1;
+ for (size_t j = 0; j < mvDicts.size(); ++j)
{
if (aLocale == mvDicts[j].aLoc)
k = j;
}
// if we have a hyphenation dictionary matching this locale
- if (k >= 0)
+ if (k != -1)
{
int nHyphenationPos = -1;
int nHyphenationPosAlt = -1;
@@ -520,9 +518,10 @@ Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const
}
int k = -1;
- for (size_t j = 0; j < mvDicts.size(); j++)
+ for (size_t j = 0; j < mvDicts.size(); ++j)
{
- if (aLocale == mvDicts[j].aLoc) k = j;
+ if (aLocale == mvDicts[j].aLoc)
+ k = j;
}
// if we have a hyphenation dictionary matching this locale