r15787 by fschmid - Follow-up to fix of Bug #9444, clipping path was missing on copy/paste too.

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 6 21:26:50 CET 2010


Author: fschmid
Date: Sat Nov  6 20:26:50 2010
New Revision: 15787

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15787
Log:
Follow-up to fix of Bug #9444, clipping path was missing on copy/paste too.

Modified:
    trunk/Scribus/scribus/pageitem_desaxe.cpp

Modified: trunk/Scribus/scribus/pageitem_desaxe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15787&path=/trunk/Scribus/scribus/pageitem_desaxe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_desaxe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_desaxe.cpp Sat Nov  6 20:26:50 2010
@@ -129,6 +129,7 @@
 	result.insert("image-x-position", toXMLString(item->imageXOffset()));
 	result.insert("image-y-position", toXMLString(item->imageYOffset()));
 	result.insert("image-rotation", toXMLString(item->imageRotation()));
+	result.insert("image-clip", toXMLString(item->pixm.imgInfo.usedPath));
 	if (item->OverrideCompressionMethod)
 	{
 		result.insert("COMPRESSIONMETHODOVER", toXMLString(item->OverrideCompressionMethod));
@@ -914,12 +915,28 @@
 
 class LoadPicture_body : public Action_body
 {
+	void begin (const Xml_string& tagName, Xml_attr attr)
+	{
+		clipPath = attr["image-clip"];
+	}
 	void end (const Xml_string& /*tagname*/)
 	{
 		PageItem* item = this->dig->top<PageItem>();
 		if (item->itemType() == PageItem::ImageFrame)
 			item->loadImage(item->externalFile(), true);
-	}
+		if (item->pixm.imgInfo.PDSpathData.contains(clipPath))
+		{
+			item->imageClip = item->pixm.imgInfo.PDSpathData[clipPath].copy();
+			item->pixm.imgInfo.usedPath = clipPath;
+			QTransform cl;
+			cl.translate(item->imageXOffset()*item->imageXScale(), item->imageYOffset()*item->imageYScale());
+			cl.scale(item->imageXScale(), item->imageYScale());
+			item->imageClip.map(cl);
+			item->loadImage(item->externalFile(), true);
+		}
+	}
+private:
+	QString clipPath;
 };
 
 class LoadPicture : public MakeAction<LoadPicture_body>




More information about the scribus-commit mailing list