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

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 20 00:11:08 CEST 2010


Author: fschmid
Date: Tue Oct 19 22:11:08 2010
New Revision: 15584

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

Modified:
    branches/Version135/Scribus/scribus/colorlistbox.cpp
    branches/Version135/Scribus/scribus/dcolor.cpp
    branches/Version135/Scribus/scribus/dcolor.h

Modified: branches/Version135/Scribus/scribus/colorlistbox.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15584&path=/branches/Version135/Scribus/scribus/colorlistbox.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/colorlistbox.cpp (original)
+++ branches/Version135/Scribus/scribus/colorlistbox.cpp Tue Oct 19 22:11:08 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: branches/Version135/Scribus/scribus/dcolor.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15584&path=/branches/Version135/Scribus/scribus/dcolor.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/dcolor.cpp (original)
+++ branches/Version135/Scribus/scribus/dcolor.cpp Tue Oct 19 22:11:08 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: branches/Version135/Scribus/scribus/dcolor.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15584&path=/branches/Version135/Scribus/scribus/dcolor.h
==============================================================================
--- branches/Version135/Scribus/scribus/dcolor.h (original)
+++ branches/Version135/Scribus/scribus/dcolor.h Tue Oct 19 22:11:08 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