summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdedtv.cxx
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2019-08-15 00:31:25 -0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 10:22:59 +0100
commit9f86b320a997c77069cf93dcb32fb71f09ad1348 (patch)
treec7767f9da6a3fbd465d80f36fee8ec2a9bd567fa /svx/source/svdraw/svdedtv.cxx
parent2d8efd1afe03a4009600e914910144b70982e98d (diff)
tdf#125191 Give object copies unique names
This patch makes a unique name for a copy of an object having a user given name. Change-Id: I14a7f45cc02962fc34a1532dd5db1cb9657b41d3 Reviewed-on: https://gerrit.libreoffice.org/77500 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdedtv.cxx')
-rw-r--r--svx/source/svdraw/svdedtv.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index d83910a86746..6dfb249d911c 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -903,13 +903,14 @@ void SdrEditView::CopyMarkedObj()
GetMarkedObjectListWriteAccess().Clear();
size_t nCloneErrCnt=0;
+ std::unordered_set<rtl::OUString> aNameSet;
const size_t nMarkCount=aSourceObjectsForCopy.GetMarkCount();
for (size_t nm=0; nm<nMarkCount; ++nm) {
SdrMark* pM=aSourceObjectsForCopy.GetMark(nm);
SdrObject* pSource(pM->GetMarkedSdrObj());
SdrObject* pO(pSource->CloneSdrObject(pSource->getSdrModelFromSdrObject()));
if (pO!=nullptr) {
- pM->GetPageView()->GetObjList()->InsertObject(pO, SAL_MAX_SIZE);
+ pM->GetPageView()->GetObjList()->InsertObjectThenMakeNameUnique(pO, aNameSet);
if( bUndo )
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoCopyObject(*pO));