r15694 by fschmid - Fixed Bug #9444: "Image clipping path isn't preserved in the saved document"

scribus-commit scribus-commit at lists.scribus.net
Sat Oct 30 10:55:44 CEST 2010


Author: fschmid
Date: Sat Oct 30 08:55:44 2010
New Revision: 15694

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15694
Log:
Fixed Bug #9444: "Image clipping path isn't preserved in the saved document"

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15694&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sat Oct 30 08:55:44 2010
@@ -1727,7 +1727,8 @@
 		doc->setCurrentPage(doc->MasterPages.at(doc->MasterNames[attrs.valueAsString("OnMasterPage")]));
 		pagenr = -2;
 	}
-
+	layerFound = false;
+	clipPath = "";
 	PageItem* newItem = pasteItem(doc, attrs, baseDir, pagenr);
 	newItem->setRedrawBounding();
 	if (tagName == "MASTEROBJECT")
@@ -1773,7 +1774,6 @@
 		info.groupLastItem = groupLastItem;
 	}
 
-	bool layerFound = false;
 	struct ImageLoadRequest loadingInfo;
 #ifdef HAVE_OSG
 	struct PageItem_OSGFrame::viewDefinition currentView;
@@ -2027,6 +2027,15 @@
 		if (!newItem->Pfile.isEmpty())
 		{
 			doc->loadPict(newItem->Pfile, newItem, false);
+			if (newItem->pixm.imgInfo.PDSpathData.contains(clipPath))
+			{
+				newItem->imageClip = newItem->pixm.imgInfo.PDSpathData[clipPath].copy();
+				newItem->pixm.imgInfo.usedPath = clipPath;
+				QTransform cl;
+				cl.translate(newItem->imageXOffset()*newItem->imageXScale(), newItem->imageYOffset()*newItem->imageYScale());
+				cl.scale(newItem->imageXScale(), newItem->imageYScale());
+				newItem->imageClip.map(cl);
+			}
 			if (layerFound)
 			{
 				newItem->pixm.imgInfo.isRequest = true;
@@ -2408,18 +2417,12 @@
 			currItem->setImageXYScale(scx, scy);
 		currItem->setImageRotation(attrs.valueAsDouble("LOCALROT"));
 		clPath = attrs.valueAsString("ImageClip", "");
-		if (currItem->pixm.imgInfo.PDSpathData.contains(clPath))
-		{
-			currItem->imageClip = currItem->pixm.imgInfo.PDSpathData[clPath].copy();
-			currItem->pixm.imgInfo.usedPath = clPath;
-			QTransform cl;
-			cl.translate(currItem->imageXOffset()*currItem->imageXScale(), currItem->imageYOffset()*currItem->imageYScale());
-			cl.scale(currItem->imageXScale(), currItem->imageYScale());
-			currItem->imageClip.map(cl);
+		if (!clPath.isEmpty())
+		{
+			clipPath = clPath;
+			layerFound = true;
 		}
 		currItem->setImageShown( attrs.valueAsInt("PICART"));
-/*		currItem->BBoxX = ScCLocale::toDoubleC( obj->attribute("BBOXX"));
-		currItem->BBoxH = ScCLocale::toDoubleC( obj->attribute("BBOXH")); */
 		currItem->setLineWidth(pw);
 		UndoManager::instance()->setUndoEnabled(true);
 		break;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15694&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h Sat Oct 30 08:55:44 2010
@@ -150,6 +150,8 @@
 
 		int itemCount;
 		int itemCountM;
+		bool layerFound;
+		QString clipPath;
 };
 
 extern "C" PLUGIN_API int scribus150format_getPluginAPIVersion();




More information about the scribus-commit mailing list