From 2cc1cc0d1362c340c4a81172d087dee2d0f93c18 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 16 Sep 2016 15:45:31 +0400 Subject: [PATCH] Paste command does not change the name of the item if it does not exist --- limereport/lrpagedesignintf.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/limereport/lrpagedesignintf.cpp b/limereport/lrpagedesignintf.cpp index 49582e3..e266e44 100644 --- a/limereport/lrpagedesignintf.cpp +++ b/limereport/lrpagedesignintf.cpp @@ -1803,11 +1803,14 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader) if (parentItem){ BaseDesignIntf *item = page()->addReportItem(reader->itemClassName(), parentItem, parentItem); if (item) { - m_itemNames.push_back(item->objectName()); + QString objectName = item->objectName(); reader->readItem(item); item->setParent(parentItem); item->setParentItem(parentItem); - item->setObjectName(m_itemNames.last()); + if (page()->reportItemsByName(item->objectName()).size()>1){ + item->setObjectName(objectName); + } + m_itemNames.push_back(item->objectName()); } return true; }