r22552 by jghali - #15331: Extend the automatic addition of black, white and registration colours in the C&F dialog to Document Setup/Prefs

scribus-commit scribus-commit at lists.scribus.net
Tue May 22 21:18:28 UTC 2018


Author: jghali
Date: Tue May 22 21:18:28 2018
New Revision: 22552

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22552
Log:
#15331: Extend the automatic addition of black, white and registration colours in the C&F dialog to Document Setup/Prefs

Modified:
    trunk/Scribus/scribus/colorsetmanager.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/ui/colorsandfills.cpp

Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22552&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp	(original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp	Tue May 22 21:18:28 2018
@@ -336,6 +336,7 @@
 			return false;
 		colors = doc->PageColors;
 		colors.setDocument(doc);
+		colors.ensureDefaultColors();
 		gradients = doc->docGradients;
 		patterns = doc->docPatterns;
 		doc->PageColors = colorListBack;
@@ -344,10 +345,9 @@
 	}
 	else
 	{
-		if (importColorsFromFile(paletteFileName, colors, &gradients, merge))
-			colors.ensureDefaultColors();
-		else
+		if (!importColorsFromFile(paletteFileName, colors, &gradients, merge))
 			return false;
+		colors.ensureDefaultColors();
 	}
 	return true;
 }

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22552&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Tue May 22 21:18:28 2018
@@ -1308,6 +1308,7 @@
 	if (!tmpSet.contains(brushCpen2) && brushCpen2 != CommonStrings::None)
 		tmpSet[brushCpen2] = appPrefs.colorPrefs.DColors[brushCpen2];
 	appPrefs.colorPrefs.DColors = tmpSet;
+	appPrefs.colorPrefs.DColors.ensureDefaultColors();
 }
 
 void PrefsManager::setColorSetName(const QString& colorSetName)

Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22552&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp	(original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp	Tue May 22 21:18:28 2018
@@ -1084,6 +1084,7 @@
 			ScMessageBox::information(this, tr("Information"), "<qt>" + tr("The file %1 does not contain colors which can be imported.\nIf the file was a PostScript-based, try to import it with File -> Import. \nNot all files have DSC conformant comments where the color descriptions are located.\n This prevents importing colors from some files.\nSee the Edit Colors section of the documentation for more details.").arg(fileName) + "</qt>");
 		else
 		{
+			m_colorList.ensureDefaultColors();
 			updateGradientList();
 			updateColorList();
 			modified = true;




More information about the scribus-commit mailing list