r17958 by fschmid - Fixed Bug #11253: crash with signal 11, opening Windows > Layers and using mouse to scroll options

scribus-commit scribus-commit at lists.scribus.net
Fri Dec 14 19:21:20 UTC 2012


Author: fschmid
Date: Fri Dec 14 19:21:20 2012
New Revision: 17958

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17958
Log:
Fixed Bug #11253: crash with signal 11, opening Windows > Layers and using mouse to scroll options

Modified:
    trunk/Scribus/scribus/ui/layers.cpp

Modified: trunk/Scribus/scribus/ui/layers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17958&path=/trunk/Scribus/scribus/ui/layers.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/layers.cpp (original)
+++ trunk/Scribus/scribus/ui/layers.cpp Fri Dec 14 19:21:20 2012
@@ -267,6 +267,8 @@
 
 void LayerPalette::addLayer()
 {
+	if (!m_Doc)
+		return;
 	m_Doc->addLayer(QString::null, true);
 	rebuildList();
 	markActiveLayer();
@@ -276,6 +278,8 @@
 
 void LayerPalette::dupLayer()
 {
+	if (!m_Doc)
+		return;
 	UndoTransaction *copyTransaction = NULL;
 	if(UndoManager::undoEnabled())
 		copyTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction("", Um::ILayerAction, Um::DuplicateLayer.arg(m_Doc->activeLayerName()) , "", Um::ICreate) );
@@ -298,6 +302,8 @@
 
 void LayerPalette::removeLayer()
 {
+	if (!m_Doc)
+		return;
 	int layerCount=m_Doc->layerCount();
 	if (layerCount < 2)
 		return;
@@ -325,6 +331,8 @@
 
 void LayerPalette::upLayer()
 {
+	if (!m_Doc)
+		return;
 	int layerCount=m_Doc->layerCount();
 	if ((layerCount < 2) || (Table->currentRow() == 0))
 		return;
@@ -339,6 +347,8 @@
 
 void LayerPalette::downLayer()
 {
+	if (!m_Doc)
+		return;
 	int layerCount=m_Doc->layerCount();
 	if ((layerCount < 2) || (Table->currentRow() == static_cast<int>(layerCount) - 1))
 		return;
@@ -353,6 +363,8 @@
 
 void LayerPalette::changeName(int row, int col)
 {
+	if (!m_Doc)
+		return;
 	if (col == 7)
 	{
 		int layerLevel = m_Doc->layerCount()-1-row;
@@ -365,6 +377,8 @@
 
 void LayerPalette::visibleLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -380,6 +394,8 @@
 
 void LayerPalette::printLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -394,6 +410,8 @@
 
 void LayerPalette::lockLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -410,6 +428,8 @@
 
 void LayerPalette::flowToggleLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -425,6 +445,8 @@
 
 void LayerPalette::outlineToggleLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -440,6 +462,8 @@
 
 void LayerPalette::selectToggleLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -494,6 +518,8 @@
 
 void LayerPalette::markLayer()
 {
+	if (!m_Doc)
+		return;
 	int level = QString(sender()->objectName()).toInt();
 	int layerID=m_Doc->layerIDFromLevel(level);
 	if (layerID==-1)
@@ -517,18 +543,24 @@
 
 void LayerPalette::changeOpacity()
 {
+	if (!m_Doc)
+		return;
 	m_Doc->setLayerTransparency(m_Doc->activeLayer(), opacitySpinBox->value() / 100.0);
 	emit LayerChanged();
 }
 
 void LayerPalette::changeBlendMode(int blend)
 {
+	if (!m_Doc)
+		return;
 	m_Doc->setLayerBlendMode(m_Doc->activeLayer(), blend);
 	emit LayerChanged();
 }
 
 void LayerPalette::markActiveLayer(int layerID)
 {
+	if (!m_Doc)
+		return;
 	disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changeBlendMode(int)));
 	disconnect(opacitySpinBox, SIGNAL(valueChanged(double)), this, SLOT(changeOpacity()));
 	disconnect(Table, SIGNAL(cellClicked(int, int)), this, SLOT(setActiveLayer(int, int)));
@@ -557,6 +589,8 @@
 
 void LayerPalette::setActiveLayer(int row, int col)
 {
+	if (!m_Doc)
+		return;
 	if (col != 7)
 	{
 		markActiveLayer(-1);




More information about the scribus-commit mailing list