mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2025-01-11 20:31:04 +03:00
PageItem cutting and deleting has been forbidden
This commit is contained in:
parent
de6ce6741f
commit
be63934c32
@ -1224,12 +1224,12 @@ void PageDesignIntf::paste()
|
|||||||
void PageDesignIntf::deleteSelected()
|
void PageDesignIntf::deleteSelected()
|
||||||
{
|
{
|
||||||
if (selectedItems().count()==1){
|
if (selectedItems().count()==1){
|
||||||
saveCommand(removeReportItemCommand(dynamic_cast<BaseDesignIntf*>(selectedItems().at(0))));
|
if (!dynamic_cast<PageItemDesignIntf*>(selectedItems().at(0)))
|
||||||
|
saveCommand(removeReportItemCommand(dynamic_cast<BaseDesignIntf*>(selectedItems().at(0))));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
QList<QGraphicsItem*> itemsToDelete = selectedItems();
|
QList<QGraphicsItem*> itemsToDelete = selectedItems();
|
||||||
|
|
||||||
|
|
||||||
CommandGroup::Ptr commandGroup = CommandGroup::create();
|
CommandGroup::Ptr commandGroup = CommandGroup::create();
|
||||||
|
|
||||||
QList<BandDesignIntf*> bands;
|
QList<BandDesignIntf*> bands;
|
||||||
@ -1270,7 +1270,7 @@ void PageDesignIntf::deleteSelected()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PageDesignIntf::cut()
|
void PageDesignIntf::cut()
|
||||||
{
|
{
|
||||||
CommandIf::Ptr command = CutCommand::create(this);
|
CommandIf::Ptr command = CutCommand::create(this);
|
||||||
saveCommand(command);
|
saveCommand(command);
|
||||||
}
|
}
|
||||||
@ -1797,11 +1797,13 @@ CommandIf::Ptr CutCommand::create(PageDesignIntf *page)
|
|||||||
command->setPage(page);
|
command->setPage(page);
|
||||||
ItemsWriterIntf *writer = new XMLWriter();
|
ItemsWriterIntf *writer = new XMLWriter();
|
||||||
foreach(QGraphicsItem * item, page->selectedItems()) {
|
foreach(QGraphicsItem * item, page->selectedItems()) {
|
||||||
BaseDesignIntf *reportItem = dynamic_cast<BaseDesignIntf *>(item);
|
if (!dynamic_cast<PageItemDesignIntf*>(item)){
|
||||||
|
BaseDesignIntf *reportItem = dynamic_cast<BaseDesignIntf *>(item);
|
||||||
if (reportItem) {
|
|
||||||
command->m_itemNames.push_back(reportItem->objectName());
|
if (reportItem) {
|
||||||
writer->putItem(reportItem);
|
command->m_itemNames.push_back(reportItem->objectName());
|
||||||
|
writer->putItem(reportItem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
command->setXML(writer->saveToString());
|
command->setXML(writer->saveToString());
|
||||||
|
Loading…
Reference in New Issue
Block a user