mirror of
https://github.com/fralx/LimeReport.git
synced 2025-09-26 17:59:08 +03:00
#284 Issue has been fixed. The objects will get new names in paste process
This commit is contained in:
@@ -132,23 +132,6 @@ void PageDesignIntf::updatePageRect()
|
||||
emit sceneRectChanged(sceneRect());
|
||||
}
|
||||
|
||||
//PageDesignIntf::Orientation PageDesignIntf::getOrientation()
|
||||
//{
|
||||
// return m_orientation;
|
||||
//}
|
||||
|
||||
//void PageDesignIntf::setPageSize(PageDesignIntf::PageSize sizeType, QSizeF sizeValue)
|
||||
//{
|
||||
// m_pageSize = sizeType;
|
||||
// m_pageSizeValue = sizeValue;
|
||||
// updatePageRect();
|
||||
//}
|
||||
|
||||
//PageDesignIntf::PageSize PageDesignIntf::pageSize() const
|
||||
//{
|
||||
// return m_pageSize;
|
||||
//}
|
||||
|
||||
void PageDesignIntf::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (event->modifiers() == Qt::NoModifier ||
|
||||
@@ -1342,9 +1325,9 @@ void PageDesignIntf::copy()
|
||||
}
|
||||
|
||||
BaseDesignIntf* PageDesignIntf::findDestObject(BaseDesignIntf* item){
|
||||
if (item && item->canContainChildren()) return item;
|
||||
if (item && item->canAcceptPaste()) return item;
|
||||
BaseDesignIntf * curItem = item;
|
||||
while (curItem && !curItem->canContainChildren()){
|
||||
while (curItem && !curItem->canAcceptPaste()){
|
||||
curItem = dynamic_cast<BaseDesignIntf*>(curItem->parentItem());
|
||||
}
|
||||
return curItem;
|
||||
@@ -2110,6 +2093,9 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader)
|
||||
if (page()->reportItemsByName(item->objectName()).size()>1){
|
||||
item->setObjectName(objectName);
|
||||
}
|
||||
foreach(QObject* child, item->children()){
|
||||
changeName(page(), child);
|
||||
};
|
||||
m_itemNames.push_back(item->objectName());
|
||||
}
|
||||
return true;
|
||||
@@ -2117,6 +2103,14 @@ bool PasteCommand::insertItem(ItemsReaderIntf::Ptr reader)
|
||||
return false;
|
||||
}
|
||||
|
||||
void PasteCommand::changeName(PageDesignIntf *page, QObject* item)
|
||||
{
|
||||
item->setObjectName(page->genObjectName(*item));
|
||||
foreach(QObject* child, item->children()){
|
||||
changeName(page, child);
|
||||
};
|
||||
}
|
||||
|
||||
CommandIf::Ptr CutCommand::create(PageDesignIntf *page)
|
||||
{
|
||||
CutCommand *command = new CutCommand();
|
||||
|
Reference in New Issue
Block a user