diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-11-08 15:30:40 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-08 17:18:31 +0000 |
commit | cc7deac7054709fada9b0867d25644f3fdbe2d06 (patch) | |
tree | 25bd66ce4ce519384e97ce3b61528d336e0f8283 /editeng | |
parent | aa92403a2b8336c5317f0fc95fac23fb7e540c89 (diff) |
longparas: same variable used for two different loops of different types
Change-Id: I1efdeb3f9bbda47d8f465a04fb36164e7ffc347b
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index fb3e00b1782a..e9ed1579218b 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -359,7 +359,6 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTx // Is the word a compounded word separated by delimiters? // If so, keep track of all delimiters so each constituent // word can be checked for two initial capital letters. - xub_StrLen n = 0; std::deque<xub_StrLen> aDelimiters; // Always check for two capitals at the beginning @@ -367,13 +366,12 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTx aDelimiters.push_back(nSttPos); // Find all compound word delimiters - for (n = nSttPos; n < nEndPos; n++) + for (xub_StrLen n = nSttPos; n < nEndPos; ++n) { if (IsAutoCorrectChar(rTxt[ n ])) { aDelimiters.push_back( n + 1 ); // Get position of char after delimiter } - } // Decide where to put the terminating delimiter. @@ -386,10 +384,10 @@ sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const OUString& rTx // Iterate through the word and all words that compose it. // Two capital letters at the beginning of word? - for(n = 0; n < aDelimiters.size() - 1; n++) + for (size_t nI = 0; nI < aDelimiters.size() - 1; ++nI) { - nSttPos = aDelimiters[n]; - nEndPos = aDelimiters[n + 1]; + nSttPos = aDelimiters[nI]; + nEndPos = aDelimiters[nI + 1]; if( nSttPos+2 < nEndPos && IsUpperLetter( rCC.getCharacterType( rTxt, nSttPos )) && |