diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-16 17:35:52 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-17 07:31:17 +0000 |
commit | afb5143639598bdc7f78ba000569d80e10d0fbe4 (patch) | |
tree | bdcb00001e370eac8eaae92b3ac873dc69c42263 /formula/source | |
parent | d8b05b5951fd446ff3fa904a6f68846f1abdb2fe (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: I1d037e87c69b1a7de019f1abf1f729bf7e28d762
Reviewed-on: https://gerrit.libreoffice.org/13494
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 4 | ||||
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 6c999bdea0bb..38988e3f3dc5 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -203,10 +203,10 @@ sal_Int32 FormulaHelper::GetFunctionStart( const OUString& rFormula, sal_Int32 nFStart = FUNC_NOTFOUND; sal_Int32 nParPos = nStart; - bool bRepeat, bFound; + bool bRepeat; do { - bFound = false; + bool bFound = false; bRepeat = false; if ( bBack ) diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 6e39f6e1e82c..ef9307590969 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -471,7 +471,6 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos) const sal_Unicode sep = m_pHelper->getFunctionManager()->getSingleToken(IFunctionManager::eSep); sal_Int32 nFuncPos = SAL_MAX_INT32; - bool bFlag = false; OUString aFormString = m_aFormulaHelper.GetCharClass()->uppercase(pMEdit->GetText()); const uno::Reference< sheet::XFormulaParser > xParser(m_pHelper->getFormulaParser()); @@ -481,6 +480,7 @@ sal_Int32 FormulaDlg_Impl::GetFunctionPos(sal_Int32 nPos) const sheet::FormulaToken* pEnd = pIter + m_aTokenList.getLength(); try { + bool bFlag = false; sal_Int32 nTokPos = 1; sal_Int32 nOldTokPos = 1; sal_Int32 nPrevFuncPos = 1; @@ -834,12 +834,11 @@ void FormulaDlg_Impl::FillControls(bool &rbNext, bool &rbPrev) DeleteArgs(); const IFunctionDescription* pOldFuncDesc = pFuncDesc; - bool bTestFlag = false; if ( m_aFormulaHelper.GetNextFunc( aFormula, false, nNextFStart, &nNextFEnd, &pFuncDesc, &m_aArguments ) ) { - bTestFlag = (pOldFuncDesc != pFuncDesc); + const bool bTestFlag = (pOldFuncDesc != pFuncDesc); if(bTestFlag) { m_pFtHeadLine->Hide(); |