diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-27 14:22:45 +0200 |
---|---|---|
committer | Ashod Nakashian <ashnakash@gmail.com> | 2017-11-29 14:03:30 +0100 |
commit | f641e9d9f472110ccb61c01210e8acf280ad9bf3 (patch) | |
tree | d00da5dacbe109966dfb2ae4b8d6a393fee91a6f | |
parent | simplify Bitmap operator==/IsEqual (stage1) (diff) | |
download | core-f641e9d9f472110ccb61c01210e8acf280ad9bf3.tar.gz core-f641e9d9f472110ccb61c01210e8acf280ad9bf3.zip |
simplify Bitmap operator==/IsEqual (stage2)
Now that we've sorted out which bits are rightfully internal (see commit
7a4064cf87d23bffac987b3e39bf87d9b4d158fc), and which bits need a
comparison operator, rename IsEqual to operator==.
Change-Id: Iec229a7571d76ee18fbc0a4fe672cc2e50a44948
Reviewed-on: https://gerrit.libreoffice.org/42851
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 09917566b6ce86ea65a246f2055b5d1f41df4e76)
Reviewed-on: https://gerrit.libreoffice.org/45456
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
-rw-r--r-- | cui/source/tabpages/backgrnd.cxx | 2 | ||||
-rw-r--r-- | include/vcl/alpha.hxx | 5 | ||||
-rw-r--r-- | include/vcl/bitmap.hxx | 6 | ||||
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/bitmap.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 4 |
6 files changed, 10 insertions, 13 deletions
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx index 59dd2a215d5b..6f5d72bab35a 100644 --- a/cui/source/tabpages/backgrnd.cxx +++ b/cui/source/tabpages/backgrnd.cxx @@ -713,7 +713,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet ) { const Graphic* pGraphic = rOldItem.GetGraphic(); if (pGraphic) - bModifyBrush = !pGraphic->GetBitmap().IsEqual(aBgdGraphic.GetBitmap()); + bModifyBrush = pGraphic->GetBitmap() != aBgdGraphic.GetBitmap(); } if (bModifyBrush) { diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx index 275d4f87526c..476ca9d06939 100644 --- a/include/vcl/alpha.hxx +++ b/include/vcl/alpha.hxx @@ -46,9 +46,8 @@ public: AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return static_cast<AlphaMask&>( Bitmap::operator=( rAlphaMask ) ); } AlphaMask& operator=( AlphaMask&& rAlphaMask ) { return static_cast<AlphaMask&>( Bitmap::operator=( std::move(rAlphaMask) ) ); } bool operator!() const { return Bitmap::operator!(); } - bool operator==( const AlphaMask& rAlphaMask ) const = delete; - bool operator!=( const AlphaMask& rAlphaMask ) const = delete; - bool IsEqual( const AlphaMask& rAlphaMask ) const { return Bitmap::IsEqual(rAlphaMask); } + bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==(rAlphaMask); } + bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=(rAlphaMask); } void SetPrefMapMode( const MapMode& rMapMode ) { Bitmap::SetPrefMapMode( rMapMode ); } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 74932051bcc4..7534c154aa38 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -229,10 +229,8 @@ public: Bitmap& operator=( const Bitmap& rBitmap ); Bitmap& operator=( Bitmap&& rBitmap ); inline bool operator!() const; - bool operator==( const Bitmap& rBitmap ) const = delete; - bool operator!=( const Bitmap& rBitmap ) const = delete; - - bool IsEqual( const Bitmap& rBmp ) const; + bool operator==( const Bitmap& rBitmap ) const; + bool operator!=( const Bitmap& rBitmap ) const { return !operator==(rBitmap); } inline bool IsEmpty() const; void SetEmpty(); diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index e1bd4914ed78..7c8913ef3cf4 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -744,8 +744,8 @@ sal_uInt16 OutlineTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 /*m const Graphic* pGrf2 = pBrsh2->GetGraphic(); if (pGrf1==pGrf2) bIsMatch = true; if (pGrf1 && pGrf2) { - if ( pGrf1->GetBitmap().IsEqual(pGrf2->GetBitmap()) && - _pSet->aSize==aFmt.GetGraphicSize()) + if ( pGrf1->GetBitmap() == pGrf2->GetBitmap() && + _pSet->aSize == aFmt.GetGraphicSize()) bIsMatch = true; } } diff --git a/vcl/source/gdi/bitmap.cxx b/vcl/source/gdi/bitmap.cxx index 15e2b0a15c95..e7490fb846f8 100644 --- a/vcl/source/gdi/bitmap.cxx +++ b/vcl/source/gdi/bitmap.cxx @@ -239,7 +239,7 @@ Bitmap& Bitmap::operator=( Bitmap&& rBitmap ) return *this; } -bool Bitmap::IsEqual( const Bitmap& rBmp ) const +bool Bitmap::operator==( const Bitmap& rBmp ) const { return rBmp.mxImpBmp == mxImpBmp || // Includes both are nullptr (rBmp.mxImpBmp && mxImpBmp && mxImpBmp->ImplIsEqual(*rBmp.mxImpBmp)); diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 4d7bb0a8bc55..26f4b40df3f4 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.IsEqual(rBitmapEx.aBitmap) ) + if( aBitmap != 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.IsEqual(rBitmapEx.aMask) && bAlpha == rBitmapEx.bAlpha; + return aMask == rBitmapEx.aMask && bAlpha == rBitmapEx.bAlpha; } bool BitmapEx::IsEmpty() const |