r15995 by christoph - Herm's fix for #8280

scribus-commit scribus-commit at lists.scribus.net
Fri Nov 26 00:49:49 CET 2010


Author: christoph
Date: Thu Nov 25 23:49:48 2010
New Revision: 15995

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15995
Log:
Herm's fix for #8280

Modified:
    branches/Version135/Scribus/scribus/pageitem_latexframe.cpp
    branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp

Modified: branches/Version135/Scribus/scribus/pageitem_latexframe.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15995&path=/branches/Version135/Scribus/scribus/pageitem_latexframe.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/pageitem_latexframe.cpp (original)
+++ branches/Version135/Scribus/scribus/pageitem_latexframe.cpp Thu Nov 25 23:49:48 2010
@@ -9,7 +9,7 @@
 						-------------------
 	begin                : Mon May 28 2007
 	copyright            : (C) 2007 by Hermann Kraus
-	email                : hermann at physiklaborant.de
+	email                : herm at scribus.info
 ***************************************************************************/
 
 /***************************************************************************
@@ -190,36 +190,32 @@
 	imgValid = true;
 
 	//Save state and restore afterwards
-	bool do_update = PictureIsAvailable;
-	double scaleX = 72.0, scaleY = 72.0, offX = 0.0, offY = 0.0;
-	if (do_update) {
-		scaleX = LocalScX * pixm.imgInfo.xres;
-		scaleY = LocalScY * pixm.imgInfo.yres;
-		offX   = LocalX   / pixm.imgInfo.xres;
-		offY   = LocalY   / pixm.imgInfo.yres;
-	}
+	double xres, yres;
+	if (PictureIsAvailable)
+	{
+		xres = pixm.imgInfo.xres;
+		yres = pixm.imgInfo.yres;
+	}
+	else
+	{
+		xres = yres = realDpi();
+	}
+	double scaleX = LocalScX * xres;
+	double scaleY = LocalScY * yres;
+	double offX   = LocalX   / xres;
+	double offY   = LocalY   / yres;
 	PageItem_ImageFrame::loadImage(imageFile, true, realDpi());
 	if (PrefsManager::instance()->latexForceDpi()) 
 	{
 		pixm.imgInfo.xres = pixm.imgInfo.yres = realDpi();
 	}
-	
-	if (do_update) 
-	{
-		//Restoring parameters
-		LocalScX = scaleX / pixm.imgInfo.xres; //Account for dpi changes!
-		LocalScY = scaleY / pixm.imgInfo.yres;
-		LocalX   = offX   * pixm.imgInfo.xres;
-		LocalY   = offY   * pixm.imgInfo.yres;
-	} 
-	else 
-	{
-		//Setting sane defaults
-		LocalX = LocalY = 0;
-		LocalScX = 72.0/pixm.imgInfo.xres;
-		LocalScY = 72.0/pixm.imgInfo.yres;
-	}
-	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY );
+
+	//Restore parameters, account for dpi changes
+	LocalScX = scaleX / pixm.imgInfo.xres;
+	LocalScY = scaleY / pixm.imgInfo.yres;
+	LocalX   = offX   * pixm.imgInfo.xres;
+	LocalY   = offY   * pixm.imgInfo.yres;
+	emit imageOffsetScale(LocalScX, LocalScY, LocalX, LocalY);
 	
 	update();
 }
@@ -428,6 +424,7 @@
 	}
 	qCritical() << "RENDER FRAME: latexError():" << 
 			tr("Running the application \"%1\" failed!").arg(config->executable()) << latex->error();
+	emit stateChanged(QProcess::NotRunning);
 }
 
 

Modified: branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15995&path=/branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ branches/Version135/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Thu Nov 25 23:49:48 2010
@@ -2187,13 +2187,7 @@
 		currItem->EmProfile = obj->attribute("EPROF","");
 		currItem->IRender   = (eRenderIntent) obj->attribute("IRENDER", "1").toInt();
 		currItem->UseEmbedded = obj->attribute("EMBEDDED", "1").toInt();
-		if (currItem->asLatexFrame())
-		{
-			currItem->setImageXYOffset(ScCLocale::toDoubleC(obj->attribute("LOCALX")) * scx, ScCLocale::toDoubleC(obj->attribute("LOCALY")) * scy);
-	//		currItem->setImageXYScale(1.0, 1.0);
-		}
-		else
-			currItem->setImageXYScale(scx, scy);
+		currItem->setImageXYScale(scx, scy);
 		clPath = obj->attribute("ImageClip", "");
 		if (currItem->pixm.imgInfo.PDSpathData.contains(clPath))
 		{




More information about the scribus-commit mailing list