summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-04-17 15:07:36 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-04-17 15:20:47 +0200
commitb76f96a520ec71308529802442aafe9364edde23 (patch)
tree280167de07f2299582fe9a2d9747c5f8c7769d95
parentd881bde066a891c921feafe0a06c568e6c3efb0f (diff)
loplugin:implicitboolconversion clean-up
Change-Id: I3c6baec2cec24e23e9bdf78882a69838f10b533c
-rw-r--r--include/vcl/salbtype.hxx12
-rw-r--r--vcl/source/gdi/cvtsvm.cxx2
-rw-r--r--vcl/source/gdi/dibtools.cxx61
-rw-r--r--vcl/source/gdi/font.cxx2
4 files changed, 41 insertions, 36 deletions
diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index d5bbc7310ac4..95d9c5834717 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -105,7 +105,7 @@ private:
sal_uInt8 mcBlueOrIndex;
sal_uInt8 mcGreen;
sal_uInt8 mcRed;
- sal_uInt8 mbIndex;
+ sal_uInt8 mbIndex; // should be bool, but see above warning
public:
@@ -272,7 +272,7 @@ inline BitmapColor::BitmapColor() :
mcBlueOrIndex ( 0 ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( false )
+ mbIndex ( sal_uInt8(false) )
{
}
@@ -280,7 +280,7 @@ inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBl
mcBlueOrIndex ( cBlue ),
mcGreen ( cGreen ),
mcRed ( cRed ),
- mbIndex ( false )
+ mbIndex ( sal_uInt8(false) )
{
}
@@ -296,7 +296,7 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
mcBlueOrIndex ( rColor.GetBlue() ),
mcGreen ( rColor.GetGreen() ),
mcRed ( rColor.GetRed() ),
- mbIndex ( 0 )
+ mbIndex ( sal_uInt8(false) )
{
}
@@ -304,14 +304,14 @@ inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
mcBlueOrIndex ( cIndex ),
mcGreen ( 0 ),
mcRed ( 0 ),
- mbIndex ( true )
+ mbIndex ( sal_uInt8(true) )
{
}
inline bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
{
return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
- ( mbIndex ? rBitmapColor.mbIndex :
+ ( mbIndex ? bool(rBitmapColor.mbIndex) :
( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) );
}
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index f732f8d83e22..3ef048230e30 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -433,7 +433,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPol
ReadPair( rIStm , aCandidate[b] );
}
- sal_uInt8 bHasFlags(false);
+ sal_uInt8 bHasFlags(int(false));
rIStm.ReadUChar( bHasFlags );
if(bHasFlags)
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx
index 044b0962b760..4267cce75d7d 100644
--- a/vcl/source/gdi/dibtools.cxx
+++ b/vcl/source/gdi/dibtools.cxx
@@ -1564,49 +1564,54 @@ bool ReadDIBBitmapEx(
if(bRetval)
{
- sal_uInt8 bTransparent(false);
+ sal_uInt8 transparent = TRANSPARENT_NONE;
- rIStm.ReadUChar( bTransparent );
+ rIStm.ReadUChar( transparent );
bRetval = !rIStm.GetError();
if(bRetval)
{
- if((sal_uInt8)TRANSPARENT_BITMAP == bTransparent)
+ switch (transparent)
{
- Bitmap aMask;
+ case TRANSPARENT_BITMAP:
+ {
+ Bitmap aMask;
- bRetval = ImplReadDIB(aMask, 0, rIStm, true);
+ bRetval = ImplReadDIB(aMask, 0, rIStm, true);
- if(bRetval)
- {
- if(!!aMask)
+ if(bRetval)
{
- // do we have an alpha mask?
- if((8 == aMask.GetBitCount()) && aMask.HasGreyPalette())
- {
- AlphaMask aAlpha;
-
- // create alpha mask quickly (without greyscale conversion)
- aAlpha.ImplSetBitmap(aMask);
- rTarget = BitmapEx(aBmp, aAlpha);
- }
- else
+ if(!!aMask)
{
- rTarget = BitmapEx(aBmp, aMask);
+ // do we have an alpha mask?
+ if((8 == aMask.GetBitCount()) && aMask.HasGreyPalette())
+ {
+ AlphaMask aAlpha;
+
+ // create alpha mask quickly (without greyscale conversion)
+ aAlpha.ImplSetBitmap(aMask);
+ rTarget = BitmapEx(aBmp, aAlpha);
+ }
+ else
+ {
+ rTarget = BitmapEx(aBmp, aMask);
+ }
}
}
+ break;
}
- }
- else if((sal_uInt8)TRANSPARENT_COLOR == bTransparent)
- {
- Color aTransparentColor;
+ case TRANSPARENT_COLOR:
+ {
+ Color aTransparentColor;
- ReadColor( rIStm, aTransparentColor );
- bRetval = !rIStm.GetError();
+ ReadColor( rIStm, aTransparentColor );
+ bRetval = !rIStm.GetError();
- if(bRetval)
- {
- rTarget = BitmapEx(aBmp, aTransparentColor);
+ if(bRetval)
+ {
+ rTarget = BitmapEx(aBmp, aTransparentColor);
+ }
+ break;
}
}
}
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index d8cf71a19055..f1c5c9cc1435 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -637,7 +637,7 @@ void Font::Merge( const vcl::Font& rFont )
SetOrientation( rFont.GetOrientation() );
SetVertical( rFont.IsVertical() );
SetEmphasisMark( rFont.GetEmphasisMark() );
- SetKerning( rFont.IsKerning() );
+ SetKerning( rFont.IsKerning() ? KERNING_FONTSPECIFIC : 0 );
SetOutline( rFont.IsOutline() );
SetShadow( rFont.IsShadow() );
SetRelief( rFont.GetRelief() );