From d1b088b84a45a61daa545d56dfd34b73531afa31 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 17 Jan 2017 09:14:06 +0000 Subject: coverity#1398817 Unintended sign extension and coverity#1398818 Unintended sign extension Change-Id: Id8eaffa6e19dd36dc59d7d63fabb398aefdcf433 --- svx/source/xoutdev/xattrbmp.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'svx/source/xoutdev/xattrbmp.cxx') diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx index d014873d6cbb..231870ad64fb 100644 --- a/svx/source/xoutdev/xattrbmp.cxx +++ b/svx/source/xoutdev/xattrbmp.cxx @@ -73,7 +73,7 @@ void XOBitmap::Bitmap2Array() ScopedVclPtrInstance< VirtualDevice > pVDev; bool bPixelColor = false; const Bitmap aBitmap( GetBitmap() ); - const sal_uInt16 nLines = 8; // type dependent + const sal_Int32 nLines = 8; // type dependent if( !pPixelArray ) pPixelArray.reset( new sal_uInt16[ nLines * nLines ] ); @@ -83,9 +83,9 @@ void XOBitmap::Bitmap2Array() aPixelColor = aBckgrColor = pVDev->GetPixel( Point() ); // create array and determine foreground and background color - for( sal_uInt16 i = 0; i < nLines; i++ ) + for (sal_Int32 i = 0; i < nLines; ++i) { - for( sal_uInt16 j = 0; j < nLines; j++ ) + for (sal_Int32 j = 0; j < nLines; ++j) { if ( pVDev->GetPixel( Point( j, i ) ) == aBckgrColor ) pPixelArray[ j + i * nLines ] = 0; @@ -105,18 +105,18 @@ void XOBitmap::Bitmap2Array() /// convert array, fore- and background color into a bitmap void XOBitmap::Array2Bitmap() { - ScopedVclPtrInstance< VirtualDevice > pVDev; - sal_uInt16 nLines = 8; // type dependent - - if( !pPixelArray ) + if (!pPixelArray) return; + ScopedVclPtrInstance< VirtualDevice > pVDev; + const sal_Int32 nLines = 8; // type dependent + pVDev->SetOutputSizePixel( Size( nLines, nLines ) ); // create bitmap - for( sal_uInt16 i = 0; i < nLines; i++ ) + for (sal_Int32 i = 0; i < nLines; ++i) { - for( sal_uInt16 j = 0; j < nLines; j++ ) + for (sal_Int32 j = 0; j < nLines; ++j) { if( pPixelArray[ j + i * nLines ] == 0 ) pVDev->DrawPixel( Point( j, i ), aBckgrColor ); -- cgit