r14033 by jghali - #8459 : invalid postscript is generated when spot color name use non latin chars

scribus-commit scribus-commit at lists.scribus.net
Wed Sep 23 20:50:15 CEST 2009


Revision: 14033
Author: jghali
Date: 2009-09-23T18:48:39.403506Z
Commit message: #8459 : invalid postscript is generated when spot color name use non latin chars

Changeset: 
M  /trunk/Scribus/scribus/pslib.cpp

Diffs:
Index: scribus/pslib.cpp
===================================================================
--- scribus/pslib.cpp	(revision 14032)
+++ scribus/pslib.cpp	(revision 14033)
@@ -97,17 +97,18 @@
 	CMYKColor cmykValues;
 	ColorList::Iterator itf;
 	int c, m, y, k;
+	int spotCount = 1;
 	bool erst = true;
 	colorsToUse = DocColors;
 	spotMap.clear();
 	colorDesc = "";
 	for (itf = DocColors.begin(); itf != DocColors.end(); ++itf)
 	{
-		if (((DocColors[itf.key()].isSpotColor()) || (DocColors[itf.key()].isRegistrationColor())) && (useSpotColors))
+		if (((itf->isSpotColor()) || (itf->isRegistrationColor())) && (useSpotColors))
 		{
-			ScColorEngine::getCMYKValues(DocColors[itf.key()], DocColors.document(), cmykValues);
+			ScColorEngine::getCMYKValues(*itf, DocColors.document(), cmykValues);
 			cmykValues.getValues(c, m, y, k);
-			colorDesc += "/Spot"+PSEncode(itf.key())+" { [ /Separation (";
+			colorDesc += "/Spot"+QString::number(spotCount)+" { [ /Separation (";
 			if (DocColors[itf.key()].isRegistrationColor())
 				colorDesc += "All";
 			else
@@ -117,7 +118,8 @@
 			colorDesc += ToStr(static_cast<double>(m) / 255)+"\nmul exch dup ";
 			colorDesc += ToStr(static_cast<double>(y) / 255)+"\nmul exch ";
 			colorDesc += ToStr(static_cast<double>(k) / 255)+" mul }] setcolorspace setcolor} bind def\n";
-			spotMap.insert(itf.key(), "Spot"+PSEncode(itf.key()));
+			spotMap.insert(itf.key(), "Spot"+QString::number(spotCount));
+			++spotCount;
 		}
 		if ((itf.key() != "Cyan") && (itf.key() != "Magenta") && (itf.key() != "Yellow") && (itf.key() != "Black") && DocColors[itf.key()].isSpotColor())
 		{
@@ -266,7 +268,8 @@
 
 void PSLib::PutStream(const QString& c)
 {
-	spoolStream.writeRawData(c.toUtf8().data(), c.length());
+	QByteArray utf8Array = c.toUtf8();
+	spoolStream.writeRawData(utf8Array.data(), utf8Array.length());
 }
 
 void PSLib::PutStream(const QByteArray& array, bool hexEnc)




More information about the scribus-commit mailing list