r18102 by jghali - fix mismatch between screen display and pdf export when an object use an incorrect pattern

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 20 02:15:49 UTC 2013


Author: jghali
Date: Sun Jan 20 02:15:48 2013
New Revision: 18102

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18102
Log:
fix mismatch between screen display and pdf export when an object use an incorrect pattern

Modified:
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18102&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Sun Jan 20 02:15:48 2013
@@ -2304,9 +2304,12 @@
 								if (!PDF_GradientFillStroke(tmpOut, ite))
 									return false;
 							}
-							PutPage(tmpOut);
-							PutPage(SetClipPath(ite));
-							PutPage(ite->fillRule ? "h\nf*\n" : "h\nf\n");
+							if (!tmpOut.isEmpty())
+							{
+								PutPage(tmpOut);
+								PutPage(SetClipPath(ite));
+								PutPage(ite->fillRule ? "h\nf*\n" : "h\nf\n");
+							}
 						}
 						else
 						{
@@ -2390,9 +2393,12 @@
 									if (!PDF_GradientFillStroke(tmpOut, ite))
 										return false;
 								}
-								PutPage(tmpOut);
-								PutPage(SetClipPath(ite));
-								PutPage(ite->fillRule ? "h\nf*\n" : "h\nf\n");
+								if (!tmpOut.isEmpty())
+								{
+									PutPage(tmpOut);
+									PutPage(SetClipPath(ite));
+									PutPage(ite->fillRule ? "h\nf*\n" : "h\nf\n");
+								}
 							}
 							else
 							{
@@ -3619,9 +3625,12 @@
 						if (!PDF_GradientFillStroke(tmpOut, ite))
 							return false;
 					}
-					tmp += tmpOut;
-					tmp += SetClipPath(ite);
-					tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					if (!tmpOut.isEmpty())
+					{
+						tmp += tmpOut;
+						tmp += SetClipPath(ite);
+						tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					}
 				}
 				else
 				{
@@ -3733,9 +3742,12 @@
 						if (!PDF_GradientFillStroke(tmpOut, ite))
 							return false;
 					}
-					tmp += tmpOut;
-					tmp += SetClipPath(ite);
-					tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					if (!tmpOut.isEmpty())
+					{
+						tmp += tmpOut;
+						tmp += SetClipPath(ite);
+						tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					}
 				}
 				else
 				{
@@ -3897,9 +3909,12 @@
 					if (!PDF_GradientFillStroke(tmpOut, ite))
 						return false;
 				}
-				tmp += tmpOut;
-				tmp += SetClipPath(ite);
-				tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+				if (!tmpOut.isEmpty())
+				{
+					tmp += tmpOut;
+					tmp += SetClipPath(ite);
+					tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+				}
 			}
 			else
 			{
@@ -3984,9 +3999,12 @@
 						if (!PDF_GradientFillStroke(tmpOut, ite))
 							return false;
 					}
-					tmp += tmpOut;
-					tmp += SetClipPath(ite);
-					tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					if (!tmpOut.isEmpty())
+					{
+						tmp += tmpOut;
+						tmp += SetClipPath(ite);
+						tmp += (ite->fillRule ? "h\nf*\n" : "h\nf\n");
+					}
 				}
 				else
 				{
@@ -6195,7 +6213,16 @@
 	QString tmp2 = "", tmpOut;
 	ScPattern *pat = NULL;
 	if (kind == 0)
+	{
+		QString itemPattern = currItem->pattern();
+		if (itemPattern.isEmpty() || !doc.docPatterns.contains(itemPattern))
+		{
+			if (currItem->fillColor() != CommonStrings::None)
+				output += putColor(currItem->fillColor(), currItem->fillShade(), true);
+			return true;
+		}
 		pat = &doc.docPatterns[currItem->pattern()];
+	}
 	else if (kind == 1)
 		pat = &doc.docPatterns[currItem->strokePattern()];
 	else if (kind == 2)




More information about the scribus-commit mailing list