r13939 by fschmid - Fixed Bug #4325: "Loading of pattern(s) is included in undo/redo"

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 29 10:35:16 CEST 2009


Revision: 13939
Author: fschmid
Date: 2009-08-29T08:31:46.977227Z
Commit message: Fixed Bug #4325: "Loading of pattern(s) is included in undo/redo"

Changeset: 
M  /trunk/Scribus/scribus/scribus.cpp
M  /trunk/Scribus/scribus/ui/patterndialog.cpp

Diffs:
Index: scribus/ui/patterndialog.cpp
===================================================================
--- scribus/ui/patterndialog.cpp	(revision 13938)
+++ scribus/ui/patterndialog.cpp	(revision 13939)
@@ -31,6 +31,7 @@
 #include "prefsfile.h"
 #include "query.h"
 #include "util.h"
+#include "undomanager.h"
 #include "stencilreader.h"
 #include "scconfig.h"
 #include "loadsaveplugin.h"
@@ -339,6 +340,8 @@
 
 void PatternDialog::loadVectors(QString data)
 {
+	bool wasUndo = UndoManager::undoEnabled();
+	UndoManager::instance()->setUndoEnabled(false);
 	m_doc->setLoading(true);
 	QFileInfo fi(data);
 	QString patNam = fi.baseName().trimmed().simplified().replace(" ", "_");
@@ -423,6 +426,7 @@
 	}
 	m_doc->setLoading(false);
 	m_doc->view()->Deselect(false);
+	UndoManager::instance()->setUndoEnabled(wasUndo);
 	m_doc->view()->DrawNew();
 }
 
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 13938)
+++ scribus/scribus.cpp	(revision 13939)
@@ -9568,6 +9568,7 @@
 	}
 	else
 		return;
+	bool wasUndo = undoManager->undoEnabled();
 	undoManager->setUndoEnabled(false);
 	int ac = doc->Items->count();
 	uint oldNum = doc->TotalItems;
@@ -9608,7 +9609,7 @@
 	doc->m_Selection->copy(itemSelection, false);
 	doc->m_Selection->delaySignalsOff();
 	view->DrawNew();
-	undoManager->setUndoEnabled(true);
+	undoManager->setUndoEnabled(wasUndo);
 }
 
 void ScribusMainWindow::managePatterns()




More information about the scribus-commit mailing list