r19423 by jghali - #12601: Convert to > Symbol disables Undo/Redo in determined condition

scribus-commit scribus-commit at lists.scribus.net
Thu Aug 14 04:31:53 UTC 2014


Author: jghali
Date: Thu Aug 14 04:31:53 2014
New Revision: 19423

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19423
Log:
#12601: Convert to > Symbol disables Undo/Redo in determined condition

Modified:
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19423&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Thu Aug 14 04:31:53 2014
@@ -9699,7 +9699,6 @@
 	doc->SnapGrid  = false;
 	doc->SnapGuides = false;
 	doc->SnapElement = false;
-	bool wasUndo = undoManager->undoEnabled();
 	undoManager->setUndoEnabled(false);
 	internalCopy = true;
 	slotEditCopy();
@@ -9777,7 +9776,7 @@
 		doc->maxCanvasCoordinate = maxSize;
 		if (outlinePalette->isVisible())
 			outlinePalette->BuildTree();
-		undoManager->setUndoEnabled(wasUndo);
+		undoManager->setUndoEnabled(true);
 		return;
 	}
 	ScPattern pat = ScPattern();
@@ -9823,7 +9822,7 @@
 	view->DrawNew();
 	if (outlinePalette->isVisible())
 		outlinePalette->BuildTree();
-	undoManager->setUndoEnabled(wasUndo);
+	undoManager->setUndoEnabled(true);
 }
 
 void ScribusMainWindow::ConvertToSymbol()
@@ -9834,7 +9833,6 @@
 	uint docSelectionCount = doc->m_Selection->count();
 	QString patternName = "Pattern_"+doc->m_Selection->itemAt(0)->itemName();
 	patternName = patternName.trimmed().simplified().replace(" ", "_");
-	bool wasUndo = undoManager->undoEnabled();
 	undoManager->setUndoEnabled(false);
 	PageItem* currItem;
 	Selection itemSelection(this, false);
@@ -9889,10 +9887,12 @@
 	dia.setForbiddenList(patternsDependingOnThis);
 	dia.setTestList(doc->docPatterns.keys());
 	dia.setCheckMode(true);
-	if (dia.exec())
-		patternName = dia.getEditText();
-	else
+	if (!dia.exec())
+	{
+		undoManager->setUndoEnabled(true);
 		return;
+	}
+	patternName = dia.getEditText();
 	ScPattern pat = ScPattern();
 	pat.setDoc(doc);
 	double minx =  std::numeric_limits<double>::max();
@@ -9951,7 +9951,7 @@
 	if (outlinePalette->isVisible())
 		outlinePalette->BuildTree();
 	view->DrawNew();
-	undoManager->setUndoEnabled(wasUndo);
+	undoManager->setUndoEnabled(true);
 }
 
 void ScribusMainWindow::managePaints()




More information about the scribus-commit mailing list