diff options
author | Gökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr> | 2018-04-16 17:07:24 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-19 12:17:25 +0200 |
commit | 07c29038d0ffb1cb62f47c61f3611b36eaf87f7c (patch) | |
tree | a2844681db90a3356f1b7c1fad6ff30430ac3b72 /sc | |
parent | 1cb700e9417224cadcf3e90b26eccaa3e2ce1156 (diff) |
cppcheck - fix variableScope in some files
Reduced the scope of some variables in source.
Change-Id: I705e7f2587fd81015f06fb301eb8d4a270668d73
Reviewed-on: https://gerrit.libreoffice.org/53042
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Gökhan Gurbetoğlu <gokhan.gurbetoglu@pardus.org.tr>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/parallelism.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/attarray.cxx | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx index 896b7c1d8382..ca6dce5c9f2f 100644 --- a/sc/qa/unit/parallelism.cxx +++ b/sc/qa/unit/parallelism.cxx @@ -288,12 +288,10 @@ void ScParallelismTest::testVLOOKUPSUM() m_xDocShell->DoHardRecalc(); - size_t nArg; for (size_t i = 0; i < nNumRows; ++i) { OString aMsg = "At row " + OString::number(i); - nArg = nNumRows - i - 1; - CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), 6*nArg + 101, static_cast<size_t>(m_pDoc->GetValue(3, i, 0))); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aMsg.getStr(), 6 * (nNumRows - i - 1) + 101, static_cast<size_t>(m_pDoc->GetValue(3, i, 0))); } m_pDoc->DeleteTab(0); } diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index c66fa7e8aa5e..071c7ae30066 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -57,7 +57,6 @@ ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, ScAttr { if ( nCol != -1 && pDefaultColAttrArray && !pDefaultColAttrArray->mvData.empty()) { - bool bNumFormatChanged; ScAddress aAdrStart( nCol, 0, nTab ); ScAddress aAdrEnd( nCol, 0, nTab ); mvData.resize( pDefaultColAttrArray->mvData.size() ); @@ -66,7 +65,7 @@ ScAttrArray::ScAttrArray( SCCOL nNewCol, SCTAB nNewTab, ScDocument* pDoc, ScAttr mvData[nIdx].nEndRow = pDefaultColAttrArray->mvData[nIdx].nEndRow; ScPatternAttr aNewPattern( *(pDefaultColAttrArray->mvData[nIdx].pPattern) ); mvData[nIdx].pPattern = static_cast<const ScPatternAttr*>( &pDocument->GetPool()->Put( aNewPattern ) ); - bNumFormatChanged = false; + bool bNumFormatChanged = false; if ( ScGlobal::CheckWidthInvalidate( bNumFormatChanged, mvData[nIdx].pPattern->GetItemSet(), pDocument->GetDefPattern()->GetItemSet() ) ) { |