From 2340c2ffe46271c5a14e8831b8a8f5b56ed2da8c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 4 Sep 2019 09:17:42 +0200 Subject: reduce Primitive2DContainer copying Change-Id: I418b17034c1949ddda1de7025821ca51f4cdb018 Reviewed-on: https://gerrit.libreoffice.org/78579 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/sdr/contact/viewcontact.hxx | 8 +++++--- include/svx/sdr/contact/viewcontactofsdrobj.hxx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'include/svx') diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index edc70af19b54..d3455ac77cd0 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -124,10 +124,12 @@ public: // add Gluepoints (if available) virtual drawinglayer::primitive2d::Primitive2DContainer createGluePointPrimitive2DSequence() const; - // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This + // Allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception - // for 3D scenes - virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const; + // for 3D scenes. + // We take the param by value, since, for the common case, we can just std::move into the param, and + // std::move the result out, avoiding copying. + virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer rSource) const; virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const; diff --git a/include/svx/sdr/contact/viewcontactofsdrobj.hxx b/include/svx/sdr/contact/viewcontactofsdrobj.hxx index df2840476bcd..2508316a7c9f 100644 --- a/include/svx/sdr/contact/viewcontactofsdrobj.hxx +++ b/include/svx/sdr/contact/viewcontactofsdrobj.hxx @@ -77,7 +77,7 @@ public: // allow embedding if needed (e.g. for SdrObjects, evtl. Name, Title and description get added). This // is a helper normally used from getViewIndependentPrimitive2DContainer(), but there is one exception // for 3D scenes - virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const override; + virtual drawinglayer::primitive2d::Primitive2DContainer embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer aSource) const override; }; }} -- cgit