|
|
|
@ -1482,11 +1482,12 @@ void UBBoardController::ClearUndoStack() |
|
|
|
|
UBGraphicsItemUndoCommand *cmd = (UBGraphicsItemUndoCommand*)UBApplication::undoStack->command(i); |
|
|
|
|
|
|
|
|
|
// go through all added and removed objects, for create list of unique objects
|
|
|
|
|
// grouped items will be deleted by groups, so we don't need do delete that items.
|
|
|
|
|
QSetIterator<QGraphicsItem*> itAdded(cmd->GetAddedList()); |
|
|
|
|
while (itAdded.hasNext()) |
|
|
|
|
{ |
|
|
|
|
QGraphicsItem* item = itAdded.next(); |
|
|
|
|
if( !uniqueItems.contains(item) ) |
|
|
|
|
if( !uniqueItems.contains(item) && !(item->parentItem() && UBGraphicsGroupContainerItem::Type == item->parentItem()->type())) |
|
|
|
|
uniqueItems.insert(item); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1494,7 +1495,7 @@ void UBBoardController::ClearUndoStack() |
|
|
|
|
while (itRemoved.hasNext()) |
|
|
|
|
{ |
|
|
|
|
QGraphicsItem* item = itRemoved.next(); |
|
|
|
|
if( !uniqueItems.contains(item) ) |
|
|
|
|
if( !uniqueItems.contains(item) && (item->parentItem() && UBGraphicsGroupContainerItem::Type != item->parentItem()->type())) |
|
|
|
|
uniqueItems.insert(item); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|