r19401 by fschmid - Fixed Bug #12581: Complete failure of AI import

scribus-commit scribus-commit at lists.scribus.net
Sun Aug 3 10:08:10 UTC 2014


Author: fschmid
Date: Sun Aug  3 10:08:10 2014
New Revision: 19401

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19401
Log:
Fixed Bug #12581: Complete failure of AI import

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19401&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Sun Aug  3 10:08:10 2014
@@ -108,6 +108,7 @@
 	GrFocalY(other.GrFocalY),
 	GrScale(other.GrScale),
 	GrSkew(other.GrSkew),
+	GrExtend(other.GrExtend),
 	GrControl1(other.GrControl1),
 	GrControl2(other.GrControl2),
 	GrControl3(other.GrControl3),
@@ -438,6 +439,7 @@
 	GrFocalY = 0;
 	GrScale = 1;
 	GrSkew = 0;
+	GrExtend = VGradient::pad;
 	GrControl1 = FPoint(0,0);
 	GrControl2 = FPoint(w, 0);
 	GrControl3 = FPoint(w, h);

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19401&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Sun Aug  3 10:08:10 2014
@@ -162,16 +162,16 @@
 			if (tempBuf.startsWith("%PDF"))
 			{
 				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-				QMessageBox msgBox(ScCore->primaryMainWindow());
-				msgBox.setText( tr("This file contains 2 versions of the data."));
-				msgBox.setInformativeText( tr("Choose which one should be imported"));
-				msgBox.setIcon(QMessageBox::Question);
-				QPushButton *pdfButton = msgBox.addButton( tr("Use the pdf part"), QMessageBox::ActionRole);
-				msgBox.addButton( tr("Use the ai part"), QMessageBox::ActionRole);
-				msgBox.setDefaultButton(pdfButton);
-				msgBox.exec();
-				if ((QPushButton *)msgBox.clickedButton() == pdfButton)
-				{
+			//	QMessageBox msgBox(ScCore->primaryMainWindow());
+			//	msgBox.setText( tr("This file contains 2 versions of the data."));
+			//	msgBox.setInformativeText( tr("Choose which one should be imported"));
+			//	msgBox.setIcon(QMessageBox::Question);
+			//	QPushButton *pdfButton = msgBox.addButton( tr("Use the pdf part"), QMessageBox::ActionRole);
+			//	msgBox.addButton( tr("Use the ai part"), QMessageBox::ActionRole);
+			//	msgBox.setDefaultButton(pdfButton);
+			//	msgBox.exec();
+			//	if ((QPushButton *)msgBox.clickedButton() == pdfButton)
+			//	{
 					//Import PDF
 					const FileFormat *fmt = LoadSavePlugin::getFormatByExt("pdf");
 					if (!fmt)
@@ -192,7 +192,7 @@
 					if (!success)
 						QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"), 1, 0, 0);
 					return success;
-				}
+			//	}
 				qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 			}
 			else if (tempBuf.startsWith("%!PS-Adobe-3.0 EPSF-3.0"))

Modified: trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19401&path=/trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp Sun Aug  3 10:08:10 2014
@@ -1815,10 +1815,6 @@
 		QString stopColor2 = getColor(color_space, &stop2, &shade);
 		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
 	}
-	if (!shading->getExtend0() || !shading->getExtend1())
-		FillGradient.setRepeatMethod(VGradient::none);
-	else
-		FillGradient.setRepeatMethod(VGradient::pad);
 	((GfxAxialShading*)shading)->getCoords(&GrStartX, &GrStartY, &GrEndX, &GrEndY);
 	double xmin, ymin, xmax, ymax;
 	// get the clip region bbox
@@ -1859,6 +1855,16 @@
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
 	ite->GrType = 6;
+	if (!shading->getExtend0() || !shading->getExtend1())
+	{
+		FillGradient.setRepeatMethod(VGradient::none);
+		ite->setGradientExtend(VGradient::none);
+	}
+	else
+	{
+		FillGradient.setRepeatMethod(VGradient::pad);
+		ite->setGradientExtend(VGradient::pad);
+	}
 	ite->fill_gradient = FillGradient;
 	ite->setGradientVector(GrStartX, GrStartY, GrEndX, GrEndY, 0, 0, 1, 0);
 	m_doc->AdjustItemSize(ite);
@@ -1913,10 +1919,6 @@
 		QString stopColor2 = getColor(color_space, &stop2, &shade);
 		FillGradient.addStop( ScColorEngine::getShadeColor(m_doc->PageColors[stopColor2], m_doc, shade), 1.0, 0.5, 1.0, stopColor2, shade );
 	}
-	if (!shading->getExtend0() || !shading->getExtend1())
-		FillGradient.setRepeatMethod(VGradient::none);
-	else
-		FillGradient.setRepeatMethod(VGradient::pad);
 	double r0, x1, y1, r1;
 	((GfxRadialShading*)shading)->getCoords(&GrStartX, &GrStartY, &r0, &x1, &y1, &r1);
 	double xmin, ymin, xmax, ymax;
@@ -1965,6 +1967,16 @@
 	ite->setLineJoin(PLineJoin);
 	ite->setTextFlowMode(PageItem::TextFlowDisabled);
 	ite->GrType = 7;
+	if (!shading->getExtend0() || !shading->getExtend1())
+	{
+		FillGradient.setRepeatMethod(VGradient::none);
+		ite->setGradientExtend(VGradient::none);
+	}
+	else
+	{
+		FillGradient.setRepeatMethod(VGradient::pad);
+		ite->setGradientExtend(VGradient::pad);
+	}
 	ite->fill_gradient = FillGradient;
 	ite->setGradientVector(GrStartX, GrStartY, GrEndX, GrEndY, GrFocalX, GrFocalY, 1, 0);
 	m_doc->AdjustItemSize(ite);




More information about the scribus-commit mailing list