r19420 by jghali - adapt plugins to latest UndoTransaction api changes

scribus-commit scribus-commit at lists.scribus.net
Thu Aug 14 02:12:41 UTC 2014


Author: jghali
Date: Thu Aug 14 02:12:41 2014
New Revision: 19420

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19420
Log:
adapt plugins to latest UndoTransaction api changes

Modified:
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp
    trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
    trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
    trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
    trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp
    trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
    trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
    trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp
    trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
    trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
    trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp
    trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp
    trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
    trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
    trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
    trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
    trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp
    trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
    trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp Thu Aug 14 02:12:41 2014
@@ -17,7 +17,6 @@
 #include "util_icon.h"
 #include "ui/paintmanager.h"
 
-#include <QSharedPointer>
 #include <QTextStream>
 
 BarcodeType::BarcodeType(QString cmd, QString exa,
@@ -300,25 +299,22 @@
 	hide();
 	const FileFormat * fmt = LoadSavePlugin::getFormatByExt("ps");
 
-	QSharedPointer<UndoTransaction> tran;
+	UndoTransaction tran;
 	if (UndoManager::undoEnabled())
 	{
-		tran = QSharedPointer<UndoTransaction>( new UndoTransaction(
-				UndoManager::instance()->beginTransaction(
+		tran = UndoManager::instance()->beginTransaction(
 							ScCore->primaryMainWindow()->doc->currentPage()->getUName(),
 							Um::IImageFrame,
 							Um::ImportBarcode,
 							ui.bcCombo->currentText() + " (" + ui.codeEdit->text() + ")",
-							Um::IEPS)
-						)
-				);
+							Um::IEPS);
 	}
 
 	if (fmt)
 	{
 		fmt->loadFile(psFile, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive);
 		if (tran)
-			tran->commit();
+			tran.commit();
 	}
 	accept();
 }

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Thu Aug 14 02:12:41 2014
@@ -136,7 +136,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -148,7 +148,7 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 #ifdef HAVE_POPPLER
 	if (!(flags & LoadSavePlugin::lfLoadAsPattern))
 	{
@@ -182,11 +182,7 @@
 					qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 					bool success = fmt->loadFile(fileName, flags);
 					if (activeTransaction)
-					{
-						activeTransaction->commit();
-						delete activeTransaction;
-						activeTransaction = NULL;
-					}
+						activeTransaction.commit();
 					if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 						UndoManager::instance()->setUndoEnabled(true);
 					if (!success)
@@ -207,11 +203,7 @@
 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 				bool success = fmt->loadFile(fileName, flags);
 				if (activeTransaction)
-				{
-					activeTransaction->commit();
-					delete activeTransaction;
-					activeTransaction = NULL;
-				}
+					activeTransaction.commit();
 				if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 					UndoManager::instance()->setUndoEnabled(true);
 				if (!success)
@@ -225,11 +217,7 @@
 	Q_CHECK_PTR(dia);
 	bool success = dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	if (!success)

Modified: trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp Thu Aug 14 02:12:41 2014
@@ -132,7 +132,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -144,7 +144,7 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	CdrPlug *dia = new CdrPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	if (!dia->import(fileName, trSettings, flags))
@@ -170,11 +170,7 @@
 		}
 	}
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp Thu Aug 14 02:12:41 2014
@@ -136,7 +136,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -148,16 +148,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	CgmPlug *dia = new CgmPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp Thu Aug 14 02:12:41 2014
@@ -129,7 +129,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -141,16 +141,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	CvgPlug *dia = new CvgPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp Thu Aug 14 02:12:41 2014
@@ -137,7 +137,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -149,16 +149,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	DrwPlug *dia = new DrwPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp Thu Aug 14 02:12:41 2014
@@ -154,7 +154,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -166,16 +166,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	IdmlPlug *dia = new IdmlPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp Thu Aug 14 02:12:41 2014
@@ -153,7 +153,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -165,16 +165,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	OdgPlug *dia = new OdgPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	bool ret = dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp Thu Aug 14 02:12:41 2014
@@ -181,7 +181,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -194,14 +194,10 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	bool importDone = dia.import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	if (dia.importCanceled)

Modified: trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp Thu Aug 14 02:12:41 2014
@@ -137,7 +137,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -149,16 +149,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	PagesPlug *dia = new PagesPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	bool ret = dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp Thu Aug 14 02:12:41 2014
@@ -130,7 +130,7 @@
 	}
 	if (m_Doc == 0)
 		m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -142,16 +142,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	PctPlug *dia = new PctPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp Thu Aug 14 02:12:41 2014
@@ -168,7 +168,7 @@
 			return false;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -180,7 +180,7 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	bool isCleanedFile = false;
 	QString cleanFile = "";
 	QFileInfo fi(fileName);
@@ -224,11 +224,7 @@
 	else
 		ret = dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp Thu Aug 14 02:12:41 2014
@@ -161,7 +161,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -173,18 +173,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-	{
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
-	}
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	EPSPlug *dia = new EPSPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp Thu Aug 14 02:12:41 2014
@@ -131,7 +131,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -143,16 +143,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	PubPlug *dia = new PubPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp Thu Aug 14 02:12:41 2014
@@ -130,7 +130,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -142,16 +142,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	ShapePlug *dia = new ShapePlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp Thu Aug 14 02:12:41 2014
@@ -130,7 +130,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -142,16 +142,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	SmlPlug *dia = new SmlPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Thu Aug 14 02:12:41 2014
@@ -172,7 +172,7 @@
 			return true;
 	}
 	
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -184,16 +184,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	SVGPlug *dia = new SVGPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(filename, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	if (dia->importCanceled)

Modified: trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp Thu Aug 14 02:12:41 2014
@@ -137,7 +137,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -149,16 +149,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	VivaPlug *dia = new VivaPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp Thu Aug 14 02:12:41 2014
@@ -131,7 +131,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -143,16 +143,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	VsdPlug *dia = new VsdPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp Thu Aug 14 02:12:41 2014
@@ -157,20 +157,16 @@
 	trSettings.actionName   = Um::ImportWMF;
 	trSettings.description  = filename;
 	trSettings.actionPixmap = Um::IWMF;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	if ((m_Doc == NULL) || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	WMFImport *dia = new WMFImport(m_Doc, flags);
 	dia->import(filename, trSettings, flags);
 	Q_CHECK_PTR(dia);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if ((m_Doc == NULL) || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	if (dia->importCanceled)

Modified: trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp Thu Aug 14 02:12:41 2014
@@ -129,7 +129,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -141,16 +141,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	WpgPlug *dia = new WpgPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp Thu Aug 14 02:12:41 2014
@@ -130,7 +130,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -142,16 +142,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	XarPlug *dia = new XarPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp Thu Aug 14 02:12:41 2014
@@ -129,7 +129,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -141,16 +141,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	XfigPlug *dia = new XfigPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp Thu Aug 14 02:12:41 2014
@@ -153,7 +153,7 @@
 			return true;
 	}
 	m_Doc=ScCore->primaryMainWindow()->doc;
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	bool emptyDoc = (m_Doc == NULL);
 	bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
 	TransactionSettings trSettings;
@@ -165,16 +165,12 @@
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+		activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
 	XpsPlug *dia = new XpsPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	bool ret = dia->import(fileName, trSettings, flags);
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
 		UndoManager::instance()->setUndoEnabled(true);
 	delete dia;

Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&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 Thu Aug 14 02:12:41 2014
@@ -132,9 +132,9 @@
 			int pointOne = dia->getFirstLinePoint();
 			int pointTwo = dia->getSecondLinePoint();
 			int mode = dia->getMode();
-			UndoTransaction *trans = NULL;
-			if(UndoManager::undoEnabled())
-				trans = new UndoTransaction(UndoManager::instance()->beginTransaction(Um::BezierCurve,Um::ILine,Um::ConnectPath,"",Um::ILine));
+			UndoTransaction trans;
+			if (UndoManager::undoEnabled())
+				trans = UndoManager::instance()->beginTransaction(Um::BezierCurve,Um::ILine,Um::ConnectPath,"",Um::ILine);
 
 			m_item1->PoLine = computePath(pointOne, pointTwo, mode, originalPath1, originalPath2);
 			m_item1->ClipEdited = true;
@@ -142,7 +142,7 @@
 			m_doc->AdjustItemSize(m_item1);
 			m_item1->OldB2 = m_item1->width();
 			m_item1->OldH2 = m_item1->height();
-			if(UndoManager::undoEnabled())
+			if (UndoManager::undoEnabled())
 			{
 				ScItemState<QPair<FPointArray,FPointArray> > *is = new ScItemState<QPair<FPointArray,FPointArray> >(Um::ConnectPath);
 				is->set("CONNECT_PATH","connect_path");
@@ -159,11 +159,7 @@
 			m_doc->itemSelection_DeleteItem();
 			m_doc->changed();
 			if (trans)
-			{
-				trans->commit();
-				delete trans;
-				trans = NULL;
-			}
+				trans.commit();
 		}
 		else
 		{

Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19420&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp Thu Aug 14 02:12:41 2014
@@ -134,10 +134,10 @@
 		return true;
 	
 	//<<#9046
-	UndoTransaction* activeTransaction = NULL;
+	UndoTransaction activeTransaction;
 	UndoManager* undoManager = UndoManager::instance();
 	if (UndoManager::undoEnabled())
-		activeTransaction = new UndoTransaction(undoManager->beginTransaction(Um::SelectionGroup, Um::IDocument, Um::PathOperation, "", Um::IPolygon));
+		activeTransaction = undoManager->beginTransaction(Um::SelectionGroup, Um::IDocument, Um::PathOperation, "", Um::IPolygon);
 	//>>#9046
 	
 	PageItem *Item1 = currDoc->m_Selection->itemAt(0);
@@ -401,11 +401,7 @@
 	
 	//<<#9046
 	if (activeTransaction)
-	{
-		activeTransaction->commit();
-		delete activeTransaction;
-		activeTransaction = NULL;
-	}
+		activeTransaction.commit();
 	//>>#9046
 	
 	return true;




More information about the scribus-commit mailing list