summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 09:07:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-31 13:09:29 +0100
commiteb5d232342b1d0f596b6e9c5f8df740a6ec614ff (patch)
tree9c5a4563ba98c427fa43aef7ee01581789708a66 /linguistic
parent33a3de2f0ce2b18d8149dc68c3de16541adfc530 (diff)
loplugin:constantparam in i18nlangtag
Change-Id: I148a47a9b63b78651ec18cd947f45b8f4dbb9345 Reviewed-on: https://gerrit.libreoffice.org/44094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/spelldta.cxx42
1 files changed, 17 insertions, 25 deletions
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index 0c8d2a2e1881..fe9f6a4202c0 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -125,7 +125,7 @@ void SeqRemoveNegEntries( std::vector< OUString > &rSeq,
{
std::vector< OUString > aNew;
// merge sequence without duplicates and empty strings in new empty sequence
- aNew = MergeProposalSeqs( aNew, rSeq, false );
+ aNew = MergeProposalSeqs( aNew, rSeq );
rSeq = aNew;
}
}
@@ -133,38 +133,30 @@ void SeqRemoveNegEntries( std::vector< OUString > &rSeq,
std::vector< OUString > MergeProposalSeqs(
std::vector< OUString > &rAlt1,
- std::vector< OUString > &rAlt2,
- bool bAllowDuplicates )
+ std::vector< OUString > &rAlt2 )
{
std::vector< OUString > aMerged;
- if (rAlt1.empty() && bAllowDuplicates)
- aMerged = rAlt2;
- else if (rAlt2.empty() && bAllowDuplicates)
- aMerged = rAlt1;
- else
- {
- size_t nAltCount1 = rAlt1.size();
- size_t nAltCount2 = rAlt2.size();
+ size_t nAltCount1 = rAlt1.size();
+ size_t nAltCount2 = rAlt2.size();
- sal_Int32 nCountNew = std::min<sal_Int32>( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS );
- aMerged.resize( nCountNew );
+ sal_Int32 nCountNew = std::min<sal_Int32>( nAltCount1 + nAltCount2, (sal_Int32) MAX_PROPOSALS );
+ aMerged.resize( nCountNew );
- sal_Int32 nIndex = 0;
- sal_Int32 i = 0;
- for (int j = 0; j < 2; j++)
+ sal_Int32 nIndex = 0;
+ sal_Int32 i = 0;
+ for (int j = 0; j < 2; j++)
+ {
+ sal_Int32 nCount = j == 0 ? nAltCount1 : nAltCount2;
+ std::vector< OUString >& rAlt = j == 0 ? rAlt1 : rAlt2;
+ for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++)
{
- sal_Int32 nCount = j == 0 ? nAltCount1 : nAltCount2;
- std::vector< OUString >& rAlt = j == 0 ? rAlt1 : rAlt2;
- for (i = 0; i < nCount && nIndex < MAX_PROPOSALS; i++)
- {
- if (!rAlt[i].isEmpty() &&
- (bAllowDuplicates || !SeqHasEntry(aMerged, rAlt[i] )))
- aMerged[ nIndex++ ] = rAlt[ i ];
- }
+ if (!rAlt[i].isEmpty() &&
+ !SeqHasEntry(aMerged, rAlt[i] ))
+ aMerged[ nIndex++ ] = rAlt[ i ];
}
- aMerged.resize( nIndex );
}
+ aMerged.resize( nIndex );
return aMerged;
}