[Libreoffice-commits] core.git: 3 commits - include/canvas include/vcl vcl/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 30 09:03:38 UTC 2016
include/canvas/vclwrapper.hxx | 16 ++++++++++++++--
include/vcl/alpha.hxx | 7 ++++---
vcl/source/gdi/alpha.cxx | 9 ---------
3 files changed, 18 insertions(+), 14 deletions(-)
New commits:
commit 673fe197751cca6477c851f6a64674ced768bc49
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 30 09:20:16 2016 +0100
coverity#1371191 Missing move assignment operator
Change-Id: If543e0685f808cfe72eaa0ff60c87bb3b1a5ea42
diff --git a/include/canvas/vclwrapper.hxx b/include/canvas/vclwrapper.hxx
index dcef39c..bdda0ce 100644
--- a/include/canvas/vclwrapper.hxx
+++ b/include/canvas/vclwrapper.hxx
@@ -79,6 +79,12 @@ namespace canvas
mpWrappee = nullptr;
}
+ VCLObject( VCLObject&& rOrig )
+ : mpWrappee(rOrig.mpWrappee)
+ {
+ rOrig.mpWrappee = nullptr;
+ }
+
// This object has value semantics, thus, forward copy
// to wrappee
VCLObject( const Wrappee& rOrig ) :
@@ -104,14 +110,20 @@ namespace canvas
return *this;
}
+ VCLObject& operator=( VCLObject&& rhs )
+ {
+ std::swap(mpWrappee, rhs.mpWrappee);
+
+ return *this;
+ }
+
~VCLObject()
{
// This here is the whole purpose of the template:
// protecting object deletion with the solar mutex
SolarMutexGuard aGuard;
- if( mpWrappee )
- delete mpWrappee;
+ delete mpWrappee;
}
Wrappee* operator->() { return mpWrappee; }
commit e214fab7a318f7881d0bd2803f54ce4e1ac2cb83
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 30 09:07:37 2016 +0100
coverity#1371302 Missing move assignment operator
Change-Id: I1dc1eab92b63198e190698d3ef514b0ac9682aad
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index 56c72eb..31a0e7a 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -34,10 +34,12 @@ public:
AlphaMask();
AlphaMask( const Bitmap& rBitmap );
AlphaMask( const AlphaMask& rAlphaMask ) = default;
+ AlphaMask( AlphaMask&& rAlphaMask ) = default;
AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = nullptr );
AlphaMask& operator=( const Bitmap& rBitmap );
AlphaMask& operator=( const AlphaMask& rAlphaMask ) = default;
+ AlphaMask& operator=( AlphaMask&& rAlphaMask ) = default;
bool operator!() const { return Bitmap::operator!(); }
bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
commit 9e09827b0111b2acd8c2b78369ed46a5732931aa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 30 09:06:00 2016 +0100
these are equal to the defaults
Change-Id: Ib1ab02264b7fc68af880c90f20d3244e42dab090
diff --git a/include/vcl/alpha.hxx b/include/vcl/alpha.hxx
index 2445cf2..56c72eb 100644
--- a/include/vcl/alpha.hxx
+++ b/include/vcl/alpha.hxx
@@ -33,12 +33,11 @@ public:
AlphaMask();
AlphaMask( const Bitmap& rBitmap );
- AlphaMask( const AlphaMask& rAlphaMask );
+ AlphaMask( const AlphaMask& rAlphaMask ) = default;
AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency = nullptr );
- virtual ~AlphaMask() override;
AlphaMask& operator=( const Bitmap& rBitmap );
- AlphaMask& operator=( const AlphaMask& rAlphaMask ) { return static_cast<AlphaMask&>( Bitmap::operator=( rAlphaMask ) ); }
+ AlphaMask& operator=( const AlphaMask& rAlphaMask ) = default;
bool operator!() const { return Bitmap::operator!(); }
bool operator==( const AlphaMask& rAlphaMask ) const { return Bitmap::operator==( rAlphaMask ); }
bool operator!=( const AlphaMask& rAlphaMask ) const { return Bitmap::operator!=( rAlphaMask ); }
diff --git a/vcl/source/gdi/alpha.cxx b/vcl/source/gdi/alpha.cxx
index 01a57f6..ec39af5 100644
--- a/vcl/source/gdi/alpha.cxx
+++ b/vcl/source/gdi/alpha.cxx
@@ -33,11 +33,6 @@ AlphaMask::AlphaMask( const Bitmap& rBitmap ) :
Bitmap::Convert( BMP_CONVERSION_8BIT_GREYS );
}
-AlphaMask::AlphaMask( const AlphaMask& rAlphaMask ) :
- Bitmap( rAlphaMask )
-{
-}
-
AlphaMask::AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency ) :
Bitmap( rSizePixel, 8, &Bitmap::GetGreyPalette( 256 ) )
{
@@ -45,10 +40,6 @@ AlphaMask::AlphaMask( const Size& rSizePixel, sal_uInt8* pEraseTransparency ) :
Bitmap::Erase( Color( *pEraseTransparency, *pEraseTransparency, *pEraseTransparency ) );
}
-AlphaMask::~AlphaMask()
-{
-}
-
AlphaMask& AlphaMask::operator=( const Bitmap& rBitmap )
{
*static_cast<Bitmap*>(this) = rBitmap;
More information about the Libreoffice-commits
mailing list