[Libreoffice-commits] core.git: include/vcl

Chris Sherlock chris.sherlock79 at gmail.com
Sun Feb 18 08:21:56 UTC 2018


 include/vcl/salbtype.hxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit bf2e3dc2a9b3801366c83b0036ca1778198fa8ae
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Feb 16 22:46:23 2018 +1100

    vcl: change mbIndex from sal_uInt8 to bool in BitmapColor
    
    In 193ec57c the comment not to change this bool was kept accidentally,
    but memcpy was removed in that commit so this is no longer an issue.
    
    Change-Id: I772d60bb940b3327f195707524b124d034f50f64
    Reviewed-on: https://gerrit.libreoffice.org/49852
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 30d59ba2c8da..1a940214501d 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -93,7 +93,7 @@ private:
     sal_uInt8               mcBlueOrIndex;
     sal_uInt8               mcGreen;
     sal_uInt8               mcRed;
-    sal_uInt8               mbIndex; // should be bool, but see above warning
+    bool                    mbIndex;
 
 public:
 
@@ -352,7 +352,7 @@ inline BitmapColor::BitmapColor() :
             mcBlueOrIndex   ( 0 ),
             mcGreen         ( 0 ),
             mcRed           ( 0 ),
-            mbIndex         ( sal_uInt8(false) )
+            mbIndex         (false)
 {
 }
 
@@ -360,7 +360,7 @@ constexpr BitmapColor::BitmapColor( sal_uInt8 cRed, sal_uInt8 cGreen, sal_uInt8
             mcBlueOrIndex   ( cBlue ),
             mcGreen         ( cGreen ),
             mcRed           ( cRed ),
-            mbIndex         ( sal_uInt8(false) )
+            mbIndex         (false)
 {
 }
 
@@ -368,7 +368,7 @@ inline BitmapColor::BitmapColor( const Color& rColor ) :
             mcBlueOrIndex   ( rColor.GetBlue() ),
             mcGreen         ( rColor.GetGreen() ),
             mcRed           ( rColor.GetRed() ),
-            mbIndex         ( sal_uInt8(false) )
+            mbIndex         (false)
 {
 }
 
@@ -376,14 +376,14 @@ inline BitmapColor::BitmapColor( sal_uInt8 cIndex ) :
             mcBlueOrIndex   ( cIndex ),
             mcGreen         ( 0 ),
             mcRed           ( 0 ),
-            mbIndex         ( sal_uInt8(true) )
+            mbIndex         (true)
 {
 }
 
 inline bool BitmapColor::operator==( const BitmapColor& rBitmapColor ) const
 {
     return( ( mcBlueOrIndex == rBitmapColor.mcBlueOrIndex ) &&
-            ( mbIndex ? bool(rBitmapColor.mbIndex) :
+            ( mbIndex ? rBitmapColor.mbIndex :
             ( mcGreen == rBitmapColor.mcGreen && mcRed == rBitmapColor.mcRed ) ) );
 }
 


More information about the Libreoffice-commits mailing list