r15501 by fschmid - Made the print preview working with GS 9.0

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 7 22:07:57 CEST 2010


Author: fschmid
Date: Thu Oct  7 20:07:57 2010
New Revision: 15501

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15501
Log:
Made the print preview working with GS 9.0

Modified:
    trunk/Scribus/scribus/ui/preview.cpp

Modified: trunk/Scribus/scribus/ui/preview.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15501&path=/trunk/Scribus/scribus/ui/preview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/preview.cpp (original)
+++ trunk/Scribus/scribus/ui/preview.cpp Thu Oct  7 20:07:57 2010
@@ -758,7 +758,7 @@
 	QStringList spots = usedSpots.keys();
 	args3.append( "-sDEVICE=tiffsep" );
 
-	args3.append( "-c" );
+//	args3.append( "-c" );
 	cmd = "<< /SeparationColorNames ";
 	QString allSeps ="[ /Cyan /Magenta /Yellow /Black ";
 	for (int sp = 0; sp < spots.count(); ++sp)
@@ -767,9 +767,18 @@
 	}
 	allSeps += "]";
 	cmd += allSeps + " /SeparationOrder [ /Cyan /Magenta /Yellow /Black] >> setpagedevice";
-	args3.append(cmd);
-
+	QFile fx(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+	if (fx.open(QIODevice::WriteOnly))
+	{
+		QTextStream tsx(&fx);
+		tsx << cmd;
+		fx.close();
+	}
 	args3.append("-f");
+	args3.append(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+//	args3.append(cmd);
+
+//	args3.append("-f");
 	QString gsExe(getShortPathName(prefsManager->ghostscriptExecutable()));
 	ret = System(gsExe, args1 + args3 + args2, ScPaths::getTempFileDir()+"/sc.tif.txt" );
 
@@ -802,9 +811,18 @@
 		{
 			args3.clear();
 			args3.append("-sDEVICE=tiffsep");
-			args3.append("-c");
-			args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+			QFile fx(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+			if (fx.open(QIODevice::WriteOnly))
+			{
+				QTextStream tsx(&fx);
+				tsx << QString("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+				fx.close();
+			}
 			args3.append("-f");
+			args3.append(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+	//		args3.append("-c");
+	//		args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+	//		args3.append("-f");
 			ret = System(gsExe, args1 + args3 + args2);
 			currSeps = "";
 			spc = 0;
@@ -814,9 +832,18 @@
 	{
 		args3.clear();
 		args3.append("-sDEVICE=tiffsep");
-		args3.append("-c");
-		args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+		QFile fx(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+		if (fx.open(QIODevice::WriteOnly))
+		{
+			QTextStream tsx(&fx);
+			tsx << QString("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+			fx.close();
+		}
 		args3.append("-f");
+		args3.append(QDir::convertSeparators(ScPaths::getTempFileDir()+"/sep.ps"));
+	//	args3.append("-c");
+	//	args3.append("<< /SeparationColorNames "+allSeps+" /SeparationOrder [ "+currSeps+" ] >> setpagedevice");
+	//	args3.append("-f");
 		ret = System(gsExe, args1 + args3 + args2);
 	}
 	return ret;
@@ -945,7 +972,7 @@
 			cms.allowColorManagement(false);
 			if (flagsVisible["Cyan"]->isChecked())
 			{
-				if (GsMinor < 54)
+				if ((GsMinor < 54) && (GsMajor < 9))
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
 				else
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Cyan.tif", 1, cms, ScImage::RGBData, 72, &mode);
@@ -961,7 +988,7 @@
 			}
 			if (flagsVisible["Magenta"]->isChecked())
 			{
-				if (GsMinor < 54)
+				if ((GsMinor < 54) && (GsMajor < 9))
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
 				else
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Magenta.tif", 1, cms, ScImage::RGBData, 72, &mode);
@@ -977,7 +1004,7 @@
 			}
 			if (flagsVisible["Yellow"]->isChecked())
 			{
-				if (GsMinor < 54)
+				if ((GsMinor < 54) && (GsMajor < 9))
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
 				else
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Yellow.tif", 1, cms, ScImage::RGBData, 72, &mode);
@@ -1000,7 +1027,7 @@
 					if (checkBox && checkBox->isChecked())
 					{
 						QString fnam;
-						if (GsMinor < 54)
+						if ((GsMinor < 54) && (GsMajor < 9))
 							fnam = QString(ScPaths::getTempFileDir()+"/sc.tif.s%1.tif").arg(sepit.value());
 						else
 							fnam = QString(ScPaths::getTempFileDir()+"/sc.s%1.tif").arg(sepit.value());
@@ -1020,7 +1047,7 @@
 			{
 				CMSettings cms(doc, "", Intent_Perceptual);
 				cms.allowColorManagement(false);
-				if (GsMinor < 54)
+				if ((GsMinor < 54) && (GsMajor < 9))
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.tif.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);
 				else
 					loaderror = im.loadPicture(ScPaths::getTempFileDir()+"/sc.Black.tif", 1, cms, ScImage::RGBData, 72, &mode);




More information about the scribus-commit mailing list