r23987 by jghali - Fix spurious undo actions created when clearing paragraph direct formatting via PP

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 18 21:06:41 UTC 2020


Author: jghali
Date: Tue Aug 18 21:06:41 2020
New Revision: 23987

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23987
Log:
Fix spurious undo actions created when clearing paragraph direct formatting via PP

Modified:
    trunk/Scribus/scribus/ui/propertiespalette_text.cpp

Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23987&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp	Tue Aug 18 21:06:41 2020
@@ -701,12 +701,20 @@
 {
 	if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveDoc || !m_haveItem)
 		return;
+
+	UndoTransaction activeTransaction;
+	if (UndoManager::undoEnabled())
+		activeTransaction = UndoManager::instance()->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::RemoveTextStyle, tr( "remove direct paragraph formatting" ), Um::IFont);
+
 	Selection tempSelection(this, false);
 	tempSelection.addItem(m_item, true);
 	m_doc->itemSelection_ClearBulNumStrings(&tempSelection);
 	m_doc->itemSelection_EraseParagraphStyle(&tempSelection);
 	CharStyle emptyCStyle;
 	m_doc->itemSelection_SetCharStyle(emptyCStyle, &tempSelection);
+
+	if (activeTransaction)
+		activeTransaction.commit();
 }
 
 void PropertiesPalette_Text::updateColorList()




More information about the scribus-commit mailing list