diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-08-22 14:10:55 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-08-23 06:04:49 +0000 |
commit | 9beb2bedc0f65b90cd35f7fa6c9b53ee6729a0c4 (patch) | |
tree | 68c6d690a594433f3ab5ce8ded149d95cbc92b69 /sc/source/ui/docshell/dbdocimp.cxx | |
parent | 90b086e480a83c62edafaf13bdf4a02079a7860c (diff) |
tdf#39440 sc: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Ia7f58c24429310b66f4464d8ba8b4f2e5c6fef38
Reviewed-on: https://gerrit.libreoffice.org/17922
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/source/ui/docshell/dbdocimp.cxx')
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index b7ea4ca7022e..bb48cd0a5f20 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -152,7 +152,6 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, SCROW nRow = rParam.nRow1; SCCOL nEndCol = nCol; // end of resulting database area SCROW nEndRow = nRow; - long i; bool bDoSelection = false; bool bRealSelection = false; // sal_True if not everything is selected @@ -281,7 +280,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, uno::Sequence<sal_Bool> aColCurr( nColCount ); // currency flag is not in types sal_Int32* pTypeArr = aColTypes.getArray(); sal_Bool* pCurrArr = aColCurr.getArray(); - for (i=0; i<nColCount; i++) + for (long i=0; i<nColCount; i++) { pTypeArr[i] = xMeta->getColumnType( i+1 ); pCurrArr[i] = xMeta->isCurrency( i+1 ); @@ -290,7 +289,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if ( !bAddrInsert ) // read column names { nCol = rParam.nCol1; - for (i=0; i<nColCount; i++) + for (long i=0; i<nColCount; i++) { pImportDoc->SetString( nCol, nRow, nTab, xMeta->getColumnLabel( i+1 ) ); @@ -342,7 +341,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if ( ValidRow(nRow) ) { nCol = rParam.nCol1; - for (i=0; i<nColCount; i++) + for (long i=0; i<nColCount; i++) { ScDatabaseDocUtil::PutData( pImportDoc, nCol, nRow, nTab, xRow, i+1, pTypeArr[i], pCurrArr[i] ); |