Kaydet (Commit) b76f96a5 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:implicitboolconversion clean-up

Change-Id: I3c6baec2cec24e23e9bdf78882a69838f10b533c
üst d881bde0
...@@ -105,7 +105,7 @@ private: ...@@ -105,7 +105,7 @@ private:
sal_uInt8 mcBlueOrIndex; sal_uInt8 mcBlueOrIndex;
sal_uInt8 mcGreen; sal_uInt8 mcGreen;
sal_uInt8 mcRed; sal_uInt8 mcRed;
sal_uInt8 mbIndex; sal_uInt8 mbIndex; // should be bool, but see above warning
public: public:
...@@ -272,7 +272,7 @@ inline BitmapColor::BitmapColor() : ...@@ -272,7 +272,7 @@ inline BitmapColor::BitmapColor() :
mcBlueOrIndex ( 0 ), mcBlueOrIndex ( 0 ),
mcGreen ( 0 ), mcGreen ( 0 ),
mcRed ( 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 ...@@ -280,7 +280,7 @@ inline BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8 cBl
mcBlueOrIndex ( cBlue ), mcBlueOrIndex ( cBlue ),
mcGreen ( cGreen ), mcGreen ( cGreen ),
mcRed ( cRed ), mcRed ( cRed ),
mbIndex ( false ) mbIndex ( sal_uInt8(false) )
{ {
} }
...@@ -296,7 +296,7 @@ inline BitmapColor::BitmapColor( const Color& rColor ) : ...@@ -296,7 +296,7 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
mcBlueOrIndex ( rColor.GetBlue() ), mcBlueOrIndex ( rColor.GetBlue() ),
mcGreen ( rColor.GetGreen() ), mcGreen ( rColor.GetGreen() ),
mcRed ( rColor.GetRed() ), mcRed ( rColor.GetRed() ),
mbIndex ( 0 ) mbIndex ( sal_uInt8(false) )
{ {
} }
...@@ -304,14 +304,14 @@ inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) : ...@@ -304,14 +304,14 @@ inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
mcBlueOrIndex ( cIndex ), mcBlueOrIndex ( cIndex ),
mcGreen ( 0 ), mcGreen ( 0 ),
mcRed ( 0 ), mcRed ( 0 ),
mbIndex ( true ) mbIndex ( sal_uInt8(true) )
{ {
} }
inline bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const inline bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
{ {
return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) && return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
( mbIndex ? rBitmapColor.mbIndex : ( mbIndex ? bool(rBitmapColor.mbIndex) :
( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) ); ( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) );
} }
......
...@@ -433,7 +433,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPol ...@@ -433,7 +433,7 @@ void ImplReadExtendedPolyPolygonAction(SvStream& rIStm, tools::PolyPolygon& rPol
ReadPair( rIStm , aCandidate[b] ); ReadPair( rIStm , aCandidate[b] );
} }
sal_uInt8 bHasFlags(false); sal_uInt8 bHasFlags(int(false));
rIStm.ReadUChar( bHasFlags ); rIStm.ReadUChar( bHasFlags );
if(bHasFlags) if(bHasFlags)
......
...@@ -1564,49 +1564,54 @@ bool ReadDIBBitmapEx( ...@@ -1564,49 +1564,54 @@ bool ReadDIBBitmapEx(
if(bRetval) if(bRetval)
{ {
sal_uInt8 bTransparent(false); sal_uInt8 transparent = TRANSPARENT_NONE;
rIStm.ReadUChar( bTransparent ); rIStm.ReadUChar( transparent );
bRetval = !rIStm.GetError(); bRetval = !rIStm.GetError();
if(bRetval) 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(bRetval)
{
if(!!aMask)
{ {
// do we have an alpha mask? if(!!aMask)
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); // 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;
} }
} case TRANSPARENT_COLOR:
else if((sal_uInt8)TRANSPARENT_COLOR == bTransparent) {
{ Color aTransparentColor;
Color aTransparentColor;
ReadColor( rIStm, aTransparentColor ); ReadColor( rIStm, aTransparentColor );
bRetval = !rIStm.GetError(); bRetval = !rIStm.GetError();
if(bRetval) if(bRetval)
{ {
rTarget = BitmapEx(aBmp, aTransparentColor); rTarget = BitmapEx(aBmp, aTransparentColor);
}
break;
} }
} }
} }
......
...@@ -637,7 +637,7 @@ void Font::Merge( const vcl::Font& rFont ) ...@@ -637,7 +637,7 @@ void Font::Merge( const vcl::Font& rFont )
SetOrientation( rFont.GetOrientation() ); SetOrientation( rFont.GetOrientation() );
SetVertical( rFont.IsVertical() ); SetVertical( rFont.IsVertical() );
SetEmphasisMark( rFont.GetEmphasisMark() ); SetEmphasisMark( rFont.GetEmphasisMark() );
SetKerning( rFont.IsKerning() ); SetKerning( rFont.IsKerning() ? KERNING_FONTSPECIFIC : 0 );
SetOutline( rFont.IsOutline() ); SetOutline( rFont.IsOutline() );
SetShadow( rFont.IsShadow() ); SetShadow( rFont.IsShadow() );
SetRelief( rFont.GetRelief() ); SetRelief( rFont.GetRelief() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment