summaryrefslogtreecommitdiff
path: root/svx/source/sdr
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-04 09:17:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-04 10:16:20 +0200
commit2340c2ffe46271c5a14e8831b8a8f5b56ed2da8c (patch)
treeb25e3c67dd1cf6a9bb85e3fbe5d6054f3d77e10e /svx/source/sdr
parent5bfa8b8d5e1cf3cb572dbd91bf3b0cfcf29fb65a (diff)
reduce Primitive2DContainer copying
Change-Id: I418b17034c1949ddda1de7025821ca51f4cdb018 Reviewed-on: https://gerrit.libreoffice.org/78579 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r--svx/source/sdr/contact/viewcontact.cxx8
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobj.cxx8
-rw-r--r--svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx2
-rw-r--r--svx/source/sdr/contact/viewcontactofvirtobj.cxx2
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx2
5 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx
index 2a6da14f0b6f..c591e6ca9df9 100644
--- a/svx/source/sdr/contact/viewcontact.cxx
+++ b/svx/source/sdr/contact/viewcontact.cxx
@@ -235,13 +235,13 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewContact::getViewInde
if(!xNew.empty())
{
// allow evtl. embedding in object-specific infos, e.g. Name, Title, Description
- xNew = embedToObjectSpecificInformation(xNew);
+ xNew = embedToObjectSpecificInformation(std::move(xNew));
}
if(mxViewIndependentPrimitive2DSequence != xNew)
{
// has changed, copy content
- const_cast< ViewContact* >(this)->mxViewIndependentPrimitive2DSequence = xNew;
+ const_cast< ViewContact* >(this)->mxViewIndependentPrimitive2DSequence = std::move(xNew);
}
// return current Primitive2DContainer
@@ -255,10 +255,10 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContact::createGluePointPrim
return drawinglayer::primitive2d::Primitive2DContainer();
}
-drawinglayer::primitive2d::Primitive2DContainer ViewContact::embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const
+drawinglayer::primitive2d::Primitive2DContainer ViewContact::embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer aSource) const
{
// nothing to do for default
- return rSource;
+ return aSource;
}
basegfx::B2DRange ViewContact::getRange( const drawinglayer::geometry::ViewInformation2D& /*rViewInfo2D*/ ) const
diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
index a679d26474fc..91e09e73e7c0 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx
@@ -174,16 +174,16 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::createGlueP
return xRetval;
}
-drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DContainer& rSource) const
+drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::embedToObjectSpecificInformation(drawinglayer::primitive2d::Primitive2DContainer aSource) const
{
- if(!rSource.empty() &&
+ if(!aSource.empty() &&
(!GetSdrObject().GetName().isEmpty() ||
!GetSdrObject().GetTitle().isEmpty() ||
!GetSdrObject().GetDescription().isEmpty()))
{
const drawinglayer::primitive2d::Primitive2DReference xRef(
new drawinglayer::primitive2d::ObjectInfoPrimitive2D(
- rSource,
+ aSource,
GetSdrObject().GetName(),
GetSdrObject().GetTitle(),
GetSdrObject().GetDescription()));
@@ -191,7 +191,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::embedToObje
return drawinglayer::primitive2d::Primitive2DContainer { xRef };
}
- return rSource;
+ return aSource;
}
}}
diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
index 8a1029138751..c88644acb6e1 100644
--- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx
@@ -135,7 +135,7 @@ namespace sdr
// only visible when transparency involved, but runtime-expensive).
// Thus: Just do not iterate, will check behaviour deeply.
b3DShape = (nullptr != dynamic_cast< const E3dObject* >(pSdrObjRepresentation));
- const drawinglayer::primitive2d::Primitive2DContainer xNew(
+ const drawinglayer::primitive2d::Primitive2DContainer& xNew(
pSdrObjRepresentation->GetViewContact().getViewIndependentPrimitive2DContainer());
xGroup.insert(xGroup.end(), xNew.begin(), xNew.end());
}
diff --git a/svx/source/sdr/contact/viewcontactofvirtobj.cxx b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
index de4a2de1f44a..c78670aa03fb 100644
--- a/svx/source/sdr/contact/viewcontactofvirtobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofvirtobj.cxx
@@ -72,7 +72,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfVirtObj::createView
}
// use method from referenced object to get the Primitive2DContainer
- const drawinglayer::primitive2d::Primitive2DContainer xSequenceVirtual(
+ const drawinglayer::primitive2d::Primitive2DContainer& xSequenceVirtual(
GetVirtObj().GetReferencedObj().GetViewContact().getViewIndependentPrimitive2DContainer());
if(!xSequenceVirtual.empty())
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 37d230372e96..35e5f8f7dcdd 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -1543,7 +1543,7 @@ namespace sdr { namespace contact {
// use the default mechanism. This will create a ControlPrimitive2D without
// handing over a XControl. If not even a XControlModel exists, it will
// create the SdrObject fallback visualisation
- drawinglayer::primitive2d::Primitive2DContainer aTmp = rViewContactOfUnoControl.getViewIndependentPrimitive2DContainer();
+ const drawinglayer::primitive2d::Primitive2DContainer& aTmp = rViewContactOfUnoControl.getViewIndependentPrimitive2DContainer();
rContainer.insert(rContainer.end(), aTmp.begin(), aTmp.end());
return;
}