diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2015-01-17 00:59:10 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-01-19 07:21:02 +0000 |
commit | ec9c7ebb575b592e188c5f6b545570b11744d063 (patch) | |
tree | e84517c0d8bfb9d004752a8b06c3812a181a7130 /vcl/generic/print | |
parent | 54defd1bd3359c95e45891c7294847d0cebca753 (diff) |
fdo#39440 vcl: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Ib6b9651b828287665f7248052855f0da2779806e
Reviewed-on: https://gerrit.libreoffice.org/13968
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/generic/print')
-rw-r--r-- | vcl/generic/print/bitmap_gfx.cxx | 3 | ||||
-rw-r--r-- | vcl/generic/print/text_gfx.cxx | 3 |
2 files changed, 3 insertions, 3 deletions
diff --git a/vcl/generic/print/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx index 9a6d7e873927..dc6997de92a2 100644 --- a/vcl/generic/print/bitmap_gfx.cxx +++ b/vcl/generic/print/bitmap_gfx.cxx @@ -625,12 +625,11 @@ PrinterGfx::DrawPS2MonoImage (const PrinterBmp& rBitmap, const Rectangle& rArea) for (long nRow = rArea.Top(); nRow <= rArea.Bottom(); nRow++) { long nBitPos = 0; - unsigned char nBit = 0; unsigned char nByte = 0; for (long nColumn = rArea.Left(); nColumn <= rArea.Right(); nColumn++) { - nBit = rBitmap.GetPixelIdx (nRow, nColumn); + unsigned char nBit = rBitmap.GetPixelIdx (nRow, nColumn); nByte |= nBit << (7 - nBitPos); if (++nBitPos == 8) diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index a262b826d8e2..eeaa02925153 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -442,7 +442,7 @@ bool PrinterGfx::drawVerticalizedText( int nTextScale = maVirtualStatus.mnTextWidth ? maVirtualStatus.mnTextWidth : maVirtualStatus.mnTextHeight; int nNormalAngle = mnTextAngle; - int nDeltaAngle, nLastPos = 0; + int nLastPos = 0; double fSin = sin( -2.0*M_PI*nNormalAngle/3600 ); double fCos = cos( -2.0*M_PI*nNormalAngle/3600 ); @@ -453,6 +453,7 @@ bool PrinterGfx::drawVerticalizedText( Point aPoint( rPoint ); for( int i = 0; i < nLen; ) { + int nDeltaAngle; while( ( nDeltaAngle = getVerticalDeltaAngle( pStr[i] ) ) == 0 && i < nLen ) i++; if( i <= nLen && i > nLastPos ) |