diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-08 12:30:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-10-09 21:05:42 +0200 |
commit | 19e37a2c8097ee4878a593cad4ce01d9fc5b24fb (patch) | |
tree | 10b91b5d87677448ec4e42c65949d813c37d65af | |
parent | f77524954702f52fe3cd3f40edac539f6a7170dc (diff) |
tdf#112939 Color on drop-down color chooser is always black
regression from
commit 404630c6052919c1a0b5dab405084c2a39fc2f5c
simplify Bitmap operator==/IsEqual (stage1)
Change-Id: Ifabbfb28e0ccbe28b19db7f2c50e6d6f55569f9a
Reviewed-on: https://gerrit.libreoffice.org/43239
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/vcl/bitmap.hxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index e0d92edfd462..b844807d7d48 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -227,6 +227,8 @@ public: inline bool operator!() const; bool operator==( const Bitmap& rBitmap ) const; bool operator!=( const Bitmap& rBitmap ) const { return !operator==(rBitmap); } + // only compares if we are using the same internal copy-on-write Impl class + bool ShallowEquals( const Bitmap& rBitmap ) const { return mxImpBmp == rBitmap.mxImpBmp; } inline bool IsEmpty() const; void SetEmpty(); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 5f27cba71e3a..658a53a5e429 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -193,7 +193,7 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const if( eTransparent != rBitmapEx.eTransparent ) return false; - if( aBitmap != rBitmapEx.aBitmap ) + if( !aBitmap.ShallowEquals(rBitmapEx.aBitmap) ) return false; if( aBitmapSize != rBitmapEx.aBitmapSize ) @@ -205,7 +205,7 @@ bool BitmapEx::operator==( const BitmapEx& rBitmapEx ) const if( eTransparent == TransparentType::Color ) return aTransparentColor == rBitmapEx.aTransparentColor; - return aMask == rBitmapEx.aMask && bAlpha == rBitmapEx.bAlpha; + return aMask.ShallowEquals(rBitmapEx.aMask) && bAlpha == rBitmapEx.bAlpha; } bool BitmapEx::IsEmpty() const |