diff options
author | Noel Grandin <noel@peralex.com> | 2015-12-11 14:59:12 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-12-15 08:17:13 +0000 |
commit | 9c9291255f474b396813256050b84ffd425002aa (patch) | |
tree | 3d8e2c89debaad8565326cadc179b681bfa5416c /include/drawinglayer | |
parent | 9b9329e479615194dda0288d699263412e5c4f1d (diff) |
create a move append method for Primitive2DContainer
since it is fairly common to append temporaries.
Change-Id: I920daf8539e42fc9fe313af48fdb34ee4aaf908d
Reviewed-on: https://gerrit.libreoffice.org/20637
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/drawinglayer')
-rw-r--r-- | include/drawinglayer/primitive2d/baseprimitive2d.hxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/drawinglayer/primitive2d/baseprimitive2d.hxx b/include/drawinglayer/primitive2d/baseprimitive2d.hxx index 850fd2e31b74..c2974215be8d 100644 --- a/include/drawinglayer/primitive2d/baseprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/baseprimitive2d.hxx @@ -58,13 +58,17 @@ namespace drawinglayer { namespace primitive2d { { public: explicit Primitive2DContainer() {} - explicit Primitive2DContainer( size_type count ) : std::vector< Primitive2DReference >(count) {} - Primitive2DContainer( const Primitive2DContainer& other ) : std::vector< Primitive2DReference >(other) {} - Primitive2DContainer( const std::vector< Primitive2DReference >& other ) : std::vector< Primitive2DReference >(other) {} - Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : std::vector< Primitive2DReference >(init) {} + explicit Primitive2DContainer( size_type count ) : vector(count) {} + Primitive2DContainer( const Primitive2DContainer& other ) : vector(other) {} + Primitive2DContainer( const Primitive2DContainer&& other ) : vector(other) {} + Primitive2DContainer( const vector< Primitive2DReference >& other ) : vector(other) {} + Primitive2DContainer( std::initializer_list<Primitive2DReference> init ) : vector(init) {} void append(const Primitive2DContainer& rSource); void append(const Primitive2DSequence& rSource); + void append(Primitive2DContainer&& rSource); + Primitive2DContainer& operator=(const Primitive2DContainer& r) { vector::operator=(r); return *this; } + Primitive2DContainer& operator=(const Primitive2DContainer&& r) { vector::operator=(r); return *this; } bool operator==(const Primitive2DContainer& rB) const; bool operator!=(const Primitive2DContainer& rB) const { return !operator==(rB); } basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D& aViewInformation) const; |