r19034 by craig - #12215: Fix crashes when changing doc or closing doc from new statusbar controls

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 15 21:04:47 UTC 2014


Author: craig
Date: Tue Apr 15 21:04:47 2014
New Revision: 19034

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19034
Log:
#12215: Fix crashes when changing doc or closing doc from new statusbar controls

Modified:
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scpainter.h
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19034&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Tue Apr 15 21:04:47 2014
@@ -6,6 +6,7 @@
 */
 
 #include "scpainter.h"
+#include "scpattern.h"
 #include "util_color.h"
 #include "util.h"
 #include "util_math.h"

Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19034&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h (original)
+++ trunk/Scribus/scribus/scpainter.h Tue Apr 15 21:04:47 2014
@@ -22,8 +22,9 @@
 #include "fpoint.h"
 #include "fpointarray.h"
 #include "vgradient.h"
-#include "scpattern.h"
 #include "mesh.h"
+
+class ScPattern;
 
 typedef struct _cairo cairo_t;
 typedef struct _cairo_surface cairo_surface_t;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19034&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Apr 15 21:04:47 2014
@@ -2333,7 +2333,8 @@
 		disconnect(layerMenu, SIGNAL(activated(int)), doc->view(), SLOT(GotoLa(int)));
 		disconnect(viewToolBar->previewQualitySwitcher, SIGNAL(activated(int)), this, SLOT(changePreviewQuality(int)));
 		disconnect(viewToolBar->visualMenu, SIGNAL(activated(int)), doc->view(), SLOT(switchPreviewVisual(int)));
-		disconnect(pageSelector);
+		disconnect(pageSelector, 0, 0, 0);
+		pageSelector->setEnabled(false);
 	}
 
 	doc = ActWin->doc();
@@ -2367,6 +2368,7 @@
 		pageSelector->setMaximum(doc->masterPageMode() ? 1 : doc->Pages->count());
 		slotSetCurrentPage(doc->currentPageNumber());
 		connect(pageSelector, SIGNAL(GotoPage(int)), this, SLOT(setCurrentPage(int)));
+		pageSelector->setEnabled(true);
 	}
 
 	if (view!=NULL)
@@ -4765,7 +4767,10 @@
 		else
 			QDir::setCurrent( QDir::homePath() );
 	}
-
+	disconnect(pageSelector, 0 ,0 ,0);
+	pageSelector->setMaximum(1);
+	pageSelector->setEnabled(false);
+	updateLayerMenu();
 	updateTableMenuActions();
 	rebuildScrapbookMenu();
 	return true;
@@ -8023,6 +8028,8 @@
 {
 	disconnect(layerMenu, SIGNAL(activated(int)), this, SLOT(GotoLa(int)));
 	layerMenu->clear();
+	if (doc==NULL)
+		return;
 	QStringList newNames;
 	doc->orderedLayerList(&newNames);
 	for (QStringList::Iterator it=newNames.begin(); it!=newNames.end(); ++it)
@@ -8037,6 +8044,8 @@
 
 void ScribusMainWindow::GotoLa(int l)
 {
+	if (doc==NULL)
+		return;
 	int level = doc->layerCount()-l-1;
 	int layerID=doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -8815,8 +8824,6 @@
 	rebuildLayersList();
 	layerPalette->rebuildList();
 	layerPalette->markActiveLayer();
-	updateLayerMenu();
-	setLayerMenuText(doc->activeLayerName());
 	updateLayerMenu();
 	setLayerMenuText(doc->activeLayerName());
 	view->DrawNew();




More information about the scribus-commit mailing list