From 404630c6052919c1a0b5dab405084c2a39fc2f5c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 27 Sep 2017 11:36:18 +0200 Subject: simplify Bitmap operator==/IsEqual (stage1) It looks like operator== is actually only useful internally. So inline that, and rename the other call sites to use IsEqual(). As a second stage, I will rename IsEqual to operator==, the intention being to make it obvious how the call sites are modified. Change-Id: I37f2920a8cafaffb25e8c5c16e6559546206684b Reviewed-on: https://gerrit.libreoffice.org/42846 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/source/gdi/bitmap.cxx | 4 ++-- vcl/source/gdi/bitmapex.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index bce74703689c..aef5cf4b2428 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -779,7 +779,7 @@ bool Bitmap::CopyPixel( const tools::Rectangle& rRectDst, if( !aRectDst.IsEmpty() ) { - if( pBmpSrc && ( *pBmpSrc != *this ) ) + if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) ) { Bitmap* pSrc = const_cast(pBmpSrc); const Size aCopySizePix( pSrc->GetSizePixel() ); @@ -958,7 +958,7 @@ bool Bitmap::CopyPixel_AlphaOptimized( const tools::Rectangle& rRectDst, const t if( !aRectDst.IsEmpty() ) { - if( pBmpSrc && ( *pBmpSrc != *this ) ) + if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) ) { Bitmap* pSrc = const_cast(pBmpSrc); const Size aCopySizePix( pSrc->GetSizePixel() ); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 99cf6846b243..4a15547435cf 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.IsEqual(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.IsEqual(rBitmapEx.aMask) && bAlpha == rBitmapEx.bAlpha; } bool BitmapEx::IsEmpty() const -- cgit