diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-17 21:16:11 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-18 06:39:15 +0000 |
commit | a23f6eb3ae49dfc326c6e57a8ab95a840c0661d2 (patch) | |
tree | e4bfa45604b2a62a6683573305763dd13f195e33 /linguistic | |
parent | 36936c2580bf15117dd3bf775dd91340d16d3239 (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Ib16e4ecc0e0c43b2c1fb527eb0668a960ae9756e
Reviewed-on: https://gerrit.libreoffice.org/13513
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/dicimp.cxx | 3 | ||||
-rw-r--r-- | linguistic/source/gciterator.cxx | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index c8d767b05cc1..bb779d249e14 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -700,10 +700,9 @@ bool DictionaryNeo::addEntry_Impl(const uno::Reference< XDictionaryEntry > xDicE // look for position to insert entry at // if there is already an entry do not insert the new one sal_Int32 nPos = 0; - bool bFound = false; if (bAddEntry) { - bFound = seekEntry( xDicEntry->getDictionaryWord(), &nPos ); + const bool bFound = seekEntry( xDicEntry->getDictionaryWord(), &nPos ); if (bFound) bAddEntry = false; } diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 41018e3fb6fe..bc31490060de 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -529,7 +529,6 @@ void GrammarCheckingIterator::DequeueAndCheck() uno::Reference< text::XFlatParagraph > xFlatPara; FPEntry aFPEntryItem; OUString aCurDocId; - bool bModified = false; // ---- THREAD SAFE START ---- { ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); @@ -548,7 +547,7 @@ void GrammarCheckingIterator::DequeueAndCheck() OUString aCurTxt( xFlatPara->getText() ); lang::Locale aCurLocale = lcl_GetPrimaryLanguageOfSentence( xFlatPara, aFPEntryItem.m_nStartIndex ); - bModified = xFlatPara->isModified(); + const bool bModified = xFlatPara->isModified(); if (!bModified) { // ---- THREAD SAFE START ---- |