r22341 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Wed Jan 10 20:43:40 UTC 2018


Author: jghali
Date: Wed Jan 10 20:43:39 2018
New Revision: 22341

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22341
Log:
fix position of imported graphics when importing vector file with scripter

Modified:
    trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp

Modified: trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22341&path=/trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/svgimport.cpp	Wed Jan 10 20:43:39 2018
@@ -46,10 +46,10 @@
 	if ((testResult != -1) && (testResult >= FORMATID_FIRSTUSER))
 	{
 		const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-		if( fmt )
+		if (fmt)
 		{
 			fmt->loadFile(fName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-			if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+			if (ScCore->primaryMainWindow()->doc->m_Selection->count() >= 1)
 			{
 				double x2, y2, w, h;
 				ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
@@ -80,10 +80,10 @@
 	if(!checkHaveDocument())
 		return NULL;
 	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_SVGIMPORT);
-	if( fmt )
-	{
-		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-		if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+	if (fmt)
+	{
+		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+		if (ScCore->primaryMainWindow()->doc->m_Selection->count() >= 1)
 		{
 			double x2, y2, w, h;
 			ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
@@ -113,10 +113,10 @@
 	if(!checkHaveDocument())
 		return NULL;
 	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_PSIMPORT);
-	if( fmt )
-	{
-		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-		if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+	if (fmt)
+	{
+		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+		if (ScCore->primaryMainWindow()->doc->m_Selection->count() >= 1)
 		{
 			double x2, y2, w, h;
 			ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
@@ -146,10 +146,10 @@
 	if(!checkHaveDocument())
 		return NULL;
 	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_SXDIMPORT);
-	if( fmt )
-	{
-		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-		if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+	if (fmt)
+	{
+		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+		if (ScCore->primaryMainWindow()->doc->m_Selection->count() >= 1)
 		{
 			double x2, y2, w, h;
 			ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
@@ -179,10 +179,10 @@
 	if(!checkHaveDocument())
 		return NULL;
 	const FileFormat * fmt = LoadSavePlugin::getFormatById(FORMATID_ODGIMPORT);
-	if( fmt )
-	{
-		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-		if (ScCore->primaryMainWindow()->doc->m_Selection->count() > 1)
+	if (fmt)
+	{
+		fmt->loadFile(QString::fromUtf8(Image), LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+		if (ScCore->primaryMainWindow()->doc->m_Selection->count() >= 1)
 		{
 			double x2, y2, w, h;
 			ScCore->primaryMainWindow()->doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);




More information about the scribus-commit mailing list