include/vcl/bitmap.hxx | 2 ++ vcl/source/gdi/bitmapex.cxx | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
New commits: commit 19e37a2c8097ee4878a593cad4ce01d9fc5b24fb Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Sun Oct 8 12:30:27 2017 +0200 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 <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits