Index: scribus/scribusdoc.cpp =================================================================== --- scribus/scribusdoc.cpp (revision 27814) +++ scribus/scribusdoc.cpp (working copy) @@ -12047,6 +12047,15 @@ return; } + // Auto note frames are recreated by note undo and can be destroyed before item undo. + QList undoItems; + undoItems.reserve(delItems.count()); + for (PageItem* item : delItems) + { + if (!item->isAutoNoteFrame()) + undoItems.append(item); + } + UndoTransaction activeTransaction; if (UndoManager::undoEnabled()) //always create transaction or check if item is reference for any mark or contains any mark or is welded etc activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, @@ -12108,10 +12117,10 @@ if (UndoManager::undoEnabled() && (selectedItemCount > 0) && !forceDeletion) { auto *is = new ScItemState< QList >(Um::Delete + " " + currItem->getUName(), "", Um::IDelete); - is->setItem(delItems); + is->setItem(undoItems); is->set("DELETE_ITEM"); is->set("ITEMID", itemList->indexOf(currItem)); - is->set("ID", selectedItemCount - (i + 1)); + is->set("ID", undoItems.indexOf(currItem)); m_undoManager->action(Pages->at(0), is, currItem->getUPixmap()); } itemList->removeAll(currItem);