0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00

Paste command does not change the name of the item if it does not exist

This commit is contained in:
Arin Alexander 2016-09-16 15:45:31 +04:00
parent 45610e7e19
commit 2cc1cc0d13

View File

@ -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;
}