r14277 by fschmid - Fixed incorrect gradients when duplicating objects.

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 10 18:50:20 CET 2009


Revision: 14277
Author: fschmid
Date: 2009-11-10T11:03:44.823487Z
Commit message: Fixed incorrect gradients when duplicating objects.

Changeset: 
M  /trunk/Scribus/scribus/serializer.cpp
M  /trunk/Scribus/scribus/pageitem_desaxe.cpp

Diffs:
Index: scribus/serializer.cpp
===================================================================
--- scribus/serializer.cpp	(revision 14276)
+++ scribus/serializer.cpp	(revision 14277)
@@ -468,6 +468,13 @@
 			if (colors.contains(grStop->name))
 				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
 		}
+		cstops = ite->stroke_gradient.colorStops();
+		for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+		{
+			grStop = cstops.at(cst);
+			if (colors.contains(grStop->name))
+				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
+		}
 	}
 	uint masterItemsCount =  m_Doc.MasterItems.count();
 	for (uint c=0; c < masterItemsCount; ++c)
@@ -480,6 +487,13 @@
 			if (colors.contains(grStop->name))
 				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
 		}
+		cstops = ite->stroke_gradient.colorStops();
+		for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+		{
+			grStop = cstops.at(cst);
+			if (colors.contains(grStop->name))
+				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
+		}
 	}
 	uint frameItemsCount = m_Doc.FrameItems.count();
 	for (uint c=0; c < frameItemsCount; ++c)
@@ -492,6 +506,13 @@
 			if (colors.contains(grStop->name))
 				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
 		}
+		cstops = ite->stroke_gradient.colorStops();
+		for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+		{
+			grStop = cstops.at(cst);
+			if (colors.contains(grStop->name))
+				grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
+		}
 	}
 	QStringList patterns =m_Doc.docPatterns.keys();
 	for (int c = 0; c < patterns.count(); ++c)
@@ -507,6 +528,13 @@
 				if (colors.contains(grStop->name))
 					grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
 			}
+			cstops = ite->stroke_gradient.colorStops();
+			for (uint cst = 0; cst < ite->stroke_gradient.Stops(); ++cst)
+			{
+				grStop = cstops.at(cst);
+				if (colors.contains(grStop->name))
+					grStop->color = SetColor(&m_Doc, grStop->name, grStop->shade);
+			}
 		}
 	}
 }
Index: scribus/pageitem_desaxe.cpp
===================================================================
--- scribus/pageitem_desaxe.cpp	(revision 14276)
+++ scribus/pageitem_desaxe.cpp	(revision 14277)
@@ -576,6 +576,17 @@
 			item->setStrokeGradient(attr["GRNAMES"]);
 			item->stroke_gradient.clearStops();
 		}
+		if (tagName=="Gradient")
+		{
+			PageItem* item = this->dig->top<PageItem>();
+			item->GrType = parseInt(attr["GRTYPE"]);
+			item->GrStartX = parseDouble(attr["GRSTARTX"]);
+			item->GrStartY = parseDouble(attr["GRSTARTY"]);
+			item->GrEndX = parseDouble(attr["GRENDX"]);
+			item->GrEndY = parseDouble(attr["GRENDY"]);
+			item->setGradient(attr["GRNAME"]);
+			item->fill_gradient.clearStops();
+		}
 	}
 };
 




More information about the scribus-commit mailing list