r18625 by jghali - #11875: "Fixed Linespacing" requires to press (n of paragraphs+1) Ctrl+Z to undo the change

scribus-commit scribus-commit at lists.scribus.net
Fri Dec 6 23:59:32 UTC 2013


Author: jghali
Date: Fri Dec  6 23:59:32 2013
New Revision: 18625

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18625
Log:
#11875: "Fixed Linespacing" requires to press (n of paragraphs+1) Ctrl+Z to undo the change

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18625&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Fri Dec  6 23:59:32 2013
@@ -9240,8 +9240,13 @@
 		return;
 	itemSelection_ClearBulNumStrings(itemSelection);
 	UndoTransaction* activeTransaction = NULL;
-	if (UndoManager::undoEnabled() && selectedItemCount > 1)
-		activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ApplyTextStyle, newStyle.displayName(), Um::IFont));
+	if (UndoManager::undoEnabled())
+	{
+		PageItem* currItem = itemSelection->itemAt(0);
+		QString  targetName = (selectedItemCount > 1) ? Um::SelectionGroup : currItem->getUName();
+		QPixmap* targetPixmap = (selectedItemCount > 1) ? Um::IGroup : currItem->getUPixmap();
+		activeTransaction = new UndoTransaction(undoManager->beginTransaction(targetName, targetPixmap, Um::ApplyTextStyle, newStyle.displayName(), Um::IFont));
+	}
 	for (uint aa = 0; aa < selectedItemCount; ++aa)
 	{
 		PageItem *currItem = itemSelection->itemAt(aa);
@@ -9327,7 +9332,12 @@
 		return;
 	UndoTransaction* activeTransaction = NULL;
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::ApplyTextStyle, newStyle.asString(), Um::IFont));
+	{
+		PageItem* currItem = itemSelection->itemAt(0);
+		QString  targetName = (selectedItemCount > 1) ? Um::SelectionGroup : currItem->getUName();
+		QPixmap* targetPixmap = (selectedItemCount > 1) ? Um::IGroup : currItem->getUPixmap();
+		activeTransaction = new UndoTransaction(undoManager->beginTransaction(targetName, targetPixmap, Um::ApplyTextStyle, newStyle.asString(), Um::IFont));
+	}
 	for (uint aa = 0; aa < selectedItemCount; ++aa)
 	{
 		PageItem *currItem = itemSelection->itemAt(aa);




More information about the scribus-commit mailing list