coverity#1371156 Missing move assignment operator

Change-Id: I187bc61678b5283843227612c243c5a09d0e7eb1
Reviewed-on: https://gerrit.libreoffice.org/29227
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2016-09-23 11:44:17 +01:00
parent c136c97875
commit d17d7c63d2
2 changed files with 14 additions and 2 deletions

View File

@@ -116,6 +116,7 @@ public:
public:
Graphic();
Graphic( const Graphic& rGraphic );
Graphic( Graphic&& rGraphic );
Graphic( const Bitmap& rBmp );
Graphic( const BitmapEx& rBmpEx );
Graphic( const SvgDataPtr& rSvgDataPtr );
@@ -125,6 +126,7 @@ public:
virtual ~Graphic() override;
Graphic& operator=( const Graphic& rGraphic );
Graphic& operator=( Graphic&& rGraphic );
bool operator==( const Graphic& rGraphic ) const;
bool operator!=( const Graphic& rGraphic ) const;
bool operator!() const;

View File

@@ -183,8 +183,7 @@ Graphic::Graphic()
{
}
Graphic::Graphic( const Graphic& rGraphic ) :
SvDataCopyStream()
Graphic::Graphic(const Graphic& rGraphic)
{
if( rGraphic.IsAnimated() )
mxImpGraphic.reset(new ImpGraphic(*rGraphic.mxImpGraphic));
@@ -192,6 +191,11 @@ SvDataCopyStream()
mxImpGraphic = rGraphic.mxImpGraphic;
}
Graphic::Graphic(Graphic&& rGraphic)
: mxImpGraphic(std::move(rGraphic.mxImpGraphic))
{
}
Graphic::Graphic(const Bitmap& rBmp)
: mxImpGraphic(new ImpGraphic(rBmp))
{
@@ -264,6 +268,12 @@ Graphic& Graphic::operator=( const Graphic& rGraphic )
return *this;
}
Graphic& Graphic::operator=(Graphic&& rGraphic)
{
mxImpGraphic = std::move(rGraphic.mxImpGraphic);
return *this;
}
bool Graphic::operator==( const Graphic& rGraphic ) const
{
return (*mxImpGraphic == *rGraphic.mxImpGraphic);