r15583 by fschmid - Fixed random crash when deleting colors in replacement color selector.

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 19 23:38:54 CEST 2010


Author: fschmid
Date: Tue Oct 19 21:38:54 2010
New Revision: 15583

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15583
Log:
Fixed random crash when deleting colors in replacement color selector.

Modified:
    trunk/Scribus/scribus/ui/colorlistbox.cpp
    trunk/Scribus/scribus/ui/dcolor.cpp
    trunk/Scribus/scribus/ui/dcolor.h

Modified: trunk/Scribus/scribus/ui/colorlistbox.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15583&path=/trunk/Scribus/scribus/ui/colorlistbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistbox.cpp (original)
+++ trunk/Scribus/scribus/ui/colorlistbox.cpp Tue Oct 19 21:38:54 2010
@@ -299,10 +299,10 @@
 			QListWidgetItem* it = itemAt(helpEvent->pos());
 			if (it != 0)
 			{
+				event->accept();
+				QString tipText = "";
 				if (cList->contains(it->text()))
 				{
-					event->accept();
-					QString tipText = "";
 					ScColor col = (*cList)[it->text()];
 					if (col.getColorModel() == colorModelCMYK)
 					{
@@ -316,9 +316,9 @@
 						col.getRawRGBColor(&r, &g, &b);
 						tipText = QString("R:%1 G:%2 B:%3").arg(r).arg(g).arg(b);
 					}
-					QToolTip::showText(helpEvent->globalPos(), tipText, this);
-					return true;
 				}
+				QToolTip::showText(helpEvent->globalPos(), tipText, this);
+				return true;
 			}
 		}
 	}

Modified: trunk/Scribus/scribus/ui/dcolor.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15583&path=/trunk/Scribus/scribus/ui/dcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dcolor.cpp (original)
+++ trunk/Scribus/scribus/ui/dcolor.cpp Tue Oct 19 21:38:54 2010
@@ -25,6 +25,7 @@
 DelColor::DelColor( QWidget* parent, ColorList colorList, QString colorName, bool haveDoc) : QDialog( parent )
 {
 	setModal(true);
+	cList = colorList;
 	setWindowTitle( tr( "Delete Color" ) );
 	setWindowIcon(QIcon(loadIcon ( "AppIcon.png" )));
 	dialogLayout = new QVBoxLayout( this );
@@ -45,10 +46,10 @@
 		replaceLabel = new QLabel( tr( "Replace With:" ), this );
 		delColorLayout->addWidget( replaceLabel, 1, 0 );
 		replacementColData = new ColorCombo(false, this);
-		colorList.remove(colorName);
+		cList.remove(colorName);
 		// 10/26/2004 pv - user can replace deleted color with "None"
 		replacementColData->addItem(CommonStrings::tr_NoneColor);
-		replacementColData->insertItems(colorList, ColorCombo::fancyPixmaps);
+		replacementColData->insertItems(cList, ColorCombo::fancyPixmaps);
 		delColorLayout->addWidget( replacementColData, 1, 1 );
 		replacementColor = replacementColData->itemText(0);
 	}

Modified: trunk/Scribus/scribus/ui/dcolor.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15583&path=/trunk/Scribus/scribus/ui/dcolor.h
==============================================================================
--- trunk/Scribus/scribus/ui/dcolor.h (original)
+++ trunk/Scribus/scribus/ui/dcolor.h Tue Oct 19 21:38:54 2010
@@ -38,6 +38,7 @@
 	QGridLayout* delColorLayout;
 	QHBoxLayout* okCancelLayout;
 	QString replacementColor;
+	ColorList cList;
 
 private slots:
     virtual void ReplaceColor(int);




More information about the scribus-commit mailing list