r20899 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Fri Feb 5 19:40:48 UTC 2016


Author: jghali
Date: Fri Feb  5 19:40:48 2016
New Revision: 20899

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20899
Log:
#13710: Duplicating a color, no difference in edit color dialog between OK and cancel

Modified:
    branches/Version14x/Scribus/scribus/colorm.cpp

Modified: branches/Version14x/Scribus/scribus/colorm.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20899&path=/branches/Version14x/Scribus/scribus/colorm.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/colorm.cpp	(original)
+++ branches/Version14x/Scribus/scribus/colorm.cpp	Fri Feb  5 19:40:48 2016
@@ -408,12 +408,40 @@
 {
 	if (paletteLocked)
 		return;
+	QString oldName = sColor;
 	QString nam = tr("Copy of %1").arg(sColor);
 	EditColors.insert(nam, EditColors[sColor]);
 	sColor = nam;
-	editColor();
-	updateCList();
-//	updateButtons();
+
+	ScColor tmpColor = EditColors[sColor];
+	CMYKChoose* dia = new CMYKChoose(this, m_Doc, tmpColor, sColor, &EditColors, customColSet, false);
+	if (dia->exec())
+	{
+		dia->Farbe.setSpotColor(dia->Separations->isChecked());
+		dia->Farbe.setRegistrationColor(tmpColor.isRegistrationColor());
+		EditColors[dia->Farbname->text()] = dia->Farbe;
+		if (sColor != dia->Farbname->text())
+		{
+			replaceMap.insert(sColor, dia->Farbname->text());
+			EditColors.remove(sColor);
+		}
+		updateCList();
+	}
+	else
+	{
+		EditColors.remove(nam);
+		sColor = oldName;
+	}
+	delete dia;
+
+	QList<QListWidgetItem *> insList = colorListBox->findItems(sColor, Qt::MatchExactly);
+	if (insList.count() > 0)
+	{
+		insList[0]->setSelected(true);
+		int newItemIndex = colorListBox->row(insList[0]);
+		colorListBox->setCurrentRow(newItemIndex);
+	}
+	updateButtons();
 }
 
 void ColorManager::newColor()
@@ -571,7 +599,7 @@
 void ColorManager::updateCList()
 {
 	colorListBox->updateBox(EditColors, ColorListBox::fancyPixmap);
-	if(colorListBox->currentItem())
+	if (colorListBox->currentItem())
 		colorListBox->currentItem()->setSelected(false);
 	updateButtons();
 }




More information about the scribus-commit mailing list