r15317 by jghali - #9250 : undoing "Paste" from another doc crashes Scribus

scribus-commit scribus-commit at lists.scribus.net
Sun Jul 11 15:20:26 CEST 2010


Revision: 15317
Author: jghali
Date: 2010-07-11T13:12:32.545103Z
Commit message: #9250 : undoing "Paste" from another doc crashes Scribus

Changeset: 
M  /branches/Version135/Scribus/scribus/scribus.cpp
M  /branches/Version135/Scribus/scribus/selection.cpp

Diffs:
Index: scribus/selection.cpp
===================================================================
--- scribus/selection.cpp	(revision 15316)
+++ scribus/selection.cpp	(revision 15317)
@@ -551,7 +551,10 @@
 	if (m_isGUISelection && (m_delaySignals <= 0))
 	{
 		setGroupRect();
-		if (guiConnect)
+		// JG - We should probably add an m_sigSelectionChanged here
+		// to avoid multiple connectItemToGUI() if sendSignals() is called 
+		// several times successively (but does that happen?)
+		if (guiConnect /*&& m_sigSelectionChanged*/)
 			connectItemToGUI();
 		if (m_sigSelectionChanged)
 			emit selectionChanged();
Index: scribus/scribus.cpp
===================================================================
--- scribus/scribus.cpp	(revision 15316)
+++ scribus/scribus.cpp	(revision 15317)
@@ -2293,12 +2293,11 @@
 	if (requiresGUI)
 	{
 		wsp->addWindow(w);
-		connect(undoManager, SIGNAL(undoRedoBegin()), tempDoc, SLOT(undoRedoBegin()));
-		connect(undoManager, SIGNAL(undoRedoDone()), tempDoc, SLOT(undoRedoDone()));
-		connect(undoManager, SIGNAL(undoRedoDone()), tempView, SLOT(DrawNew()));
-		//connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
+		//#9250 : transfered to newActWin()
+		//connect(undoManager, SIGNAL(undoRedoBegin()), tempDoc, SLOT(undoRedoBegin()));
+		//connect(undoManager, SIGNAL(undoRedoDone()), tempDoc, SLOT(undoRedoDone()));
+		//connect(undoManager, SIGNAL(undoRedoDone()), tempView, SLOT(DrawNew()));
 		connect(tempView, SIGNAL(signalGuideInformation(int, qreal)), alignDistributePalette, SLOT(setGuide(int, qreal)));
-		//	connect(w, SIGNAL(SaveAndClose()), this, SLOT(DoSaveClose()));
 	}
 	//Independent finishing tasks after tempDoc setup
 	if (showView)
@@ -2361,7 +2360,6 @@
 	alignDistributePalette->setDoc(doc);
 	connect(undoManager, SIGNAL(undoRedoDone()), view, SLOT(DrawNew()));
 	view->show();
-	//connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
 }
 
 void ScribusMainWindow::windowsMenuAboutToShow()
@@ -2437,9 +2435,23 @@
 	}
 	docCheckerPalette->clearErrorList();
 
+	if (HaveDoc && (doc != NULL) && doc->hasGUI())
+	{
+		disconnect(undoManager, SIGNAL(undoRedoBegin()), doc, SLOT(undoRedoBegin()));
+		disconnect(undoManager, SIGNAL(undoRedoDone()) , doc, SLOT(undoRedoDone()));
+		disconnect(undoManager, SIGNAL(undoRedoDone()) , doc->view(), SLOT(DrawNew()));
+	}
+
 	doc = ActWin->doc();
 	undoManager->switchStack(doc->DocName);
 
+	if ((doc != NULL) && doc->hasGUI())
+	{
+		connect(undoManager, SIGNAL(undoRedoBegin()), doc, SLOT(undoRedoBegin()));
+		connect(undoManager, SIGNAL(undoRedoDone()) , doc, SLOT(undoRedoDone()));
+		connect(undoManager, SIGNAL(undoRedoDone()) , doc->view(), SLOT(DrawNew()));
+	}
+
 	if (view!=NULL)
 	{
 		actionManager->disconnectNewViewActions();
@@ -3972,7 +3984,6 @@
 			doc->PDF_Options.LPISettings.insert("Black", lpo);
 		}
 
-		//connect(w, SIGNAL(Schliessen()), this, SLOT(DoFileClose()));
 		if (!doc->CMSSettings.CMSinUse)
 			doc->HasCMS = false;
 		if ((ScCore->haveCMS()) && (doc->CMSSettings.CMSinUse))
@@ -9065,7 +9076,6 @@
 			{
 				std::cout << "Saving: " << doc->DocName.toStdString() << ".emergency" << std::endl;
 				doc->autoSaveTimer->stop();
-				//disconnect(ActWin, SIGNAL(Schliessen()), ScMW, SLOT(DoFileClose()));
 				FileLoader fl(doc->DocName+".emergency");
 				fl.SaveFile(doc->DocName+".emergency", doc, 0);
 			}




More information about the scribus-commit mailing list