r18884 by jghali - #12119: "Connect Paths" creates useless entries in "Action History"

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 7 07:51:27 UTC 2014


Author: jghali
Date: Fri Mar  7 07:51:26 2014
New Revision: 18884

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18884
Log:
#12119: "Connect Paths" creates useless entries in "Action History"

Modified:
    trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp

Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18884&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp Fri Mar  7 07:51:26 2014
@@ -145,19 +145,19 @@
 			{
 				ScItemState<QPair<FPointArray,FPointArray> > *is = new ScItemState<QPair<FPointArray,FPointArray> >(Um::ConnectPath);
 				is->set("CONNECT_PATH","connect_path");
-				is->set("OLDX",originalXPos);
-				is->set("OLDY",originalYPos);
-				is->set("NEWX",m_item1->xPos());
-				is->set("NEWY",m_item1->yPos());
+				is->set("OLDX", originalXPos);
+				is->set("OLDY", originalYPos);
+				is->set("NEWX", m_item1->xPos());
+				is->set("NEWY", m_item1->yPos());
 				is->setItem(qMakePair(originalPath1, m_item1->PoLine));
-				UndoManager::instance()->action(m_item1,is);
+				UndoManager::instance()->action(m_item1, is);
 			}
 			m_item1->updateClip();
 			m_item1->ContourLine = m_item1->PoLine.copy();
 			m_doc->m_Selection->removeItem(m_item1);
 			m_doc->itemSelection_DeleteItem();
 			m_doc->changed();
-			if(trans)
+			if (trans)
 			{
 				trans->commit();
 				delete trans;
@@ -184,6 +184,8 @@
 
 void PathConnectPlugin::updateEffect(int effectType, int pointOne, int pointTwo, int mode)
 {
+	// #12119: unnecessary to save actions generated by preview
+	UndoManager::instance()->setUndoEnabled(false);
 	if (effectType == -1)
 	{
 		m_item1->PoLine = originalPath1.copy();
@@ -213,6 +215,7 @@
 	}
 	if (effectType != -1)
 		firstUpdate = false;
+	UndoManager::instance()->setUndoEnabled(true);
 }
 
 FPointArray PathConnectPlugin::computePath(int pointOne, int pointTwo, int mode, FPointArray &p1, FPointArray &p2)




More information about the scribus-commit mailing list