r24083 by jghali - #16271: Undo truncate content on multiple frames only undoes one frame

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 15 20:54:35 UTC 2020


Author: jghali
Date: Thu Oct 15 20:54:34 2020
New Revision: 24083

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24083
Log:
#16271: Undo truncate content on multiple frames only undoes one frame

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24083&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Thu Oct 15 20:54:34 2020
@@ -11032,11 +11032,20 @@
 	int selectedItemCount = itemSelection->count();
 	if (selectedItemCount <= 0)
 		return;
+
+	UndoTransaction undoTransaction;
+	if (UndoManager::undoEnabled() && (selectedItemCount > 1))
+		undoTransaction = UndoManager::instance()->beginTransaction(Um::Selection, Um::IGroup, Um::TruncateText);
+
 	for (int i = 0; i < selectedItemCount; ++i)
 	{
 		PageItem *currItem = itemSelection->itemAt(i);
 		currItem->truncateContents();
 	}
+
+	if (undoTransaction)
+		undoTransaction.commit();
+
 	regionsChanged()->update(QRectF());
 	changed();
 }




More information about the scribus-commit mailing list