r21893 by jghali - #14736: "All" color rendering

scribus-commit scribus-commit at lists.scribus.net
Fri Apr 14 12:04:10 UTC 2017


Author: jghali
Date: Fri Apr 14 12:04:10 2017
New Revision: 21893

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21893
Log:
#14736: "All" color rendering

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21893&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Fri Apr 14 12:04:10 2017
@@ -1166,6 +1166,12 @@
 	color.setSpotColor( attrs.valueAsBool("Spot", false) );
 	color.setRegistrationColor( attrs.valueAsBool("Register", false) );
 	QString name = attrs.valueAsString("NAME");
+	if (name == "All")
+	{
+		color.setSpotColor(true);
+		color.setRegistrationColor(true);
+		color.setColor(255, 255, 255, 255);
+	}
 	colors.insert((name.isEmpty()) ? color.name() : name, color);
 	return true;
 }

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21893&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Fri Apr 14 12:04:10 2017
@@ -2393,6 +2393,12 @@
 	color.setSpotColor( attrs.valueAsBool("Spot", false) );
 	color.setRegistrationColor( attrs.valueAsBool("Register", false) );
 	QString name = attrs.valueAsString("NAME", color.name());
+	if (name == "All")
+	{
+		color.setSpotColor(true);
+		color.setRegistrationColor(true);
+		color.setColor(255, 255, 255, 255);
+	}
 	// #10323 : break loading of doc which contain colors with different names
 	// and same definition
 	// colors.tryAddColor(name, color);

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21893&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp	Fri Apr 14 12:04:10 2017
@@ -174,15 +174,26 @@
 	else if (color_space->getMode() == csSeparation)
 	{
 		GfxCMYK cmyk;
-		color_space->getCMYK(color, &cmyk);
-		int Cc = qRound(colToDbl(cmyk.c) * 255);
-		int Mc = qRound(colToDbl(cmyk.m) * 255);
-		int Yc = qRound(colToDbl(cmyk.y) * 255);
-		int Kc = qRound(colToDbl(cmyk.k) * 255);
+		QString name = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString());
+		int Cc, Mc, Yc, Kc;
+		bool isRegistrationColor = (name == "All");
+		if (!isRegistrationColor)
+		{
+			color_space->getCMYK(color, &cmyk);
+			Cc = qRound(colToDbl(cmyk.c) * 255);
+			Mc = qRound(colToDbl(cmyk.m) * 255);
+			Yc = qRound(colToDbl(cmyk.y) * 255);
+			Kc = qRound(colToDbl(cmyk.k) * 255);
+		}
+		else
+		{
+			Cc = Mc = Yc = Kc = 255;
+			tmp.setRegistrationColor(true);
+			name = "Registration";
+		}
 		tmp.setColor(Cc, Mc, Yc, Kc);
 		tmp.setSpotColor(true);
-		QString nam = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString());
-		fNam = m_doc->PageColors.tryAddColor(nam, tmp);
+		fNam = m_doc->PageColors.tryAddColor(name, tmp);
 		*shade = qRound(colToDbl(color->c[0]) * 100);
 	}
 	else
@@ -3810,15 +3821,27 @@
 	else if (color_space->getMode() == csSeparation)
 	{
 		GfxCMYK cmyk;
-		color_space->getCMYK(color, &cmyk);
-		int Cc = qRound(colToDbl(cmyk.c) * 255);
-		int Mc = qRound(colToDbl(cmyk.m) * 255);
-		int Yc = qRound(colToDbl(cmyk.y) * 255);
-		int Kc = qRound(colToDbl(cmyk.k) * 255);
+		QString name = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString());
+		int Cc, Mc, Yc, Kc;
+		bool isRegistrationColor = (name == "All");
+		if (!isRegistrationColor)
+		{
+			color_space->getCMYK(color, &cmyk);
+			Cc = qRound(colToDbl(cmyk.c) * 255);
+			Mc = qRound(colToDbl(cmyk.m) * 255);
+			Yc = qRound(colToDbl(cmyk.y) * 255);
+			Kc = qRound(colToDbl(cmyk.k) * 255);
+		}
+		else
+		{
+			Cc = Mc = Yc = Kc = 255;
+			tmp.setRegistrationColor(true);
+			name = "Registration";
+		}
 		tmp.setColor(Cc, Mc, Yc, Kc);
 		tmp.setSpotColor(true);
-		QString nam = QString(((GfxSeparationColorSpace*)color_space)->getName()->getCString());
-		fNam = m_doc->PageColors.tryAddColor(nam, tmp);
+
+		fNam = m_doc->PageColors.tryAddColor(name, tmp);
 		*shade = qRound(colToDbl(color->c[0]) * 100);
 	}
 	else




More information about the scribus-commit mailing list