diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-20 20:47:39 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-12-21 19:07:03 +0100 |
commit | 8870e068cc7368ffa14a6938836b370d2a188b64 (patch) | |
tree | de1cc65476db4132af13ca0950af92a65cec6e67 /sc/source/ui/view/output.cxx | |
parent | 17402c73cfd513ade823a5f26c17371766047b6d (diff) |
fdo#39440 sc: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Icd031be4aeec07ba60804923e3506d64cf876dd8
Diffstat (limited to 'sc/source/ui/view/output.cxx')
-rw-r--r-- | sc/source/ui/view/output.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 6fc29bb75369..36dd56d1d374 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -414,11 +414,10 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) ++nVisX; nPosY = nScrY; - long nNextY; for (nArrY=1; nArrY+1<nArrCount; nArrY++) { RowInfo* pThisRowInfo = &pRowInfo[nArrY]; - nNextY = nPosY + pThisRowInfo->nHeight; + const long nNextY = nPosY + pThisRowInfo->nHeight; bool bHOver = pThisRowInfo->pCellInfo[nXplus1].bHideGrid; if (!bHOver) @@ -516,10 +515,9 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) if ( bLayoutRTL ) nPosX += nMirrorW - nOneX; - long nNextX; for (SCCOL i=nX1; i<=nX2; i++) { - nNextX = nPosX + pRowInfo[0].pCellInfo[i+1].nWidth * nLayoutSign; + const long nNextX = nPosX + pRowInfo[0].pCellInfo[i+1].nWidth * nLayoutSign; if (nNextX != nPosX) // visible { bool bVOver; @@ -1000,7 +998,6 @@ void ScOutputData::DrawBackground() const SvxBrushItem* pOldBackground = NULL; const SvxBrushItem* pBackground; const Color* pOldColor = NULL; - const Color* pColor = NULL; const ScDataBarInfo* pOldDataBarInfo = NULL; const ScIconSetInfo* pOldIconSetInfo = NULL; for (SCCOL nX=nX1; nX<=nX2; nX++) @@ -1041,7 +1038,7 @@ void ScOutputData::DrawBackground() pBackground = lcl_FindBackground( mpDoc, nX, nY, nTab ); } - pColor = pInfo->pColorScale.get(); + const Color* pColor = pInfo->pColorScale.get(); const ScDataBarInfo* pDataBarInfo = pInfo->pDataBar.get(); const ScIconSetInfo* pIconSetInfo = pInfo->pIconSet.get(); drawCells( pColor, pBackground, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo ); |