summaryrefslogtreecommitdiff
path: root/svx/source/xoutdev/xattrbmp.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-17 09:14:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-17 09:16:39 +0000
commitd1b088b84a45a61daa545d56dfd34b73531afa31 (patch)
tree13cae723e6565c926d708b28ca62ac021f5e4e47 /svx/source/xoutdev/xattrbmp.cxx
parent2ccc311712e39109991ed9b0fd82e9e82ccf3b7d (diff)
coverity#1398817 Unintended sign extension
and coverity#1398818 Unintended sign extension Change-Id: Id8eaffa6e19dd36dc59d7d63fabb398aefdcf433
Diffstat (limited to 'svx/source/xoutdev/xattrbmp.cxx')
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx18
1 files changed, 9 insertions, 9 deletions
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 );