summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-27 11:36:18 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2017-12-05 08:19:26 -0500
commitc30f0d7eb04e6ddc9c1522a745e3bd3bdd622643 (patch)
tree2ac28cb5bd78b02cbf342ea5fde5cdccebfc1409 /vcl
parentd87778376321abac9de5ad4bc79bf2b35c679738 (diff)
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 <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 404630c6052919c1a0b5dab405084c2a39fc2f5c) Reviewed-on: https://gerrit.libreoffice.org/45455 Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Tested-by: Ashod Nakashian <ashnakash@gmail.com> (cherry picked from commit 00f776ba53975fea14faa78ffa7b06e7bf5fbf6b)
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/bitmap.cxx4
-rw-r--r--vcl/source/gdi/bitmapex.cxx4
2 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx
index c0ab50050668..15e2b0a15c95 100644
--- a/vcl/source/gdi/bitmap.cxx
+++ b/vcl/source/gdi/bitmap.cxx
@@ -786,7 +786,7 @@ bool Bitmap::CopyPixel( const Rectangle& rRectDst,
if( !aRectDst.IsEmpty() )
{
- if( pBmpSrc && ( *pBmpSrc != *this ) )
+ if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) )
{
Bitmap* pSrc = const_cast<Bitmap*>(pBmpSrc);
const Size aCopySizePix( pSrc->GetSizePixel() );
@@ -965,7 +965,7 @@ bool Bitmap::CopyPixel_AlphaOptimized( const Rectangle& rRectDst, const Rectangl
if( !aRectDst.IsEmpty() )
{
- if( pBmpSrc && ( *pBmpSrc != *this ) )
+ if( pBmpSrc && ( pBmpSrc->mxImpBmp != mxImpBmp ) )
{
Bitmap* pSrc = const_cast<Bitmap*>(pBmpSrc);
const Size aCopySizePix( pSrc->GetSizePixel() );
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index f8def3cdc1b8..4d7bb0a8bc55 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -206,7 +206,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 )
@@ -218,7 +218,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