r15815 by jghali - #9479 : crash importing SVG file into scribus

scribus-commit scribus-commit at lists.scribus.net
Mon Nov 8 20:38:23 CET 2010


Author: jghali
Date: Mon Nov  8 19:38:22 2010
New Revision: 15815

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15815
Log:
#9479 : crash importing SVG file into scribus 

Modified:
    branches/Version135/Scribus/scribus/plugins/import/svg/svgplugin.cpp

Modified: branches/Version135/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15815&path=/branches/Version135/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ branches/Version135/Scribus/scribus/plugins/import/svg/svgplugin.cpp Mon Nov  8 19:38:22 2010
@@ -2365,10 +2365,13 @@
 	QStringList substyles = style.split(';', QString::SkipEmptyParts);
 	for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
 	{
-		QStringList substyle = (*it).split(':', QString::SkipEmptyParts);
-		QString command(substyle[0].trimmed());
-		QString params(substyle[1].trimmed());
-		parsePA( obj, command, params );
+		QStringList substyle = it->split(':', QString::SkipEmptyParts);
+		if (substyle.count() >= 2)
+		{
+			QString command(substyle.at(0).trimmed());
+			QString params(substyle.at(1).trimmed());
+			parsePA( obj, command, params );
+		}
 	}
 	return;
 }
@@ -2409,13 +2412,16 @@
 				QStringList substyles = style.split(';', QString::SkipEmptyParts);
 				for( QStringList::Iterator it = substyles.begin(); it != substyles.end(); ++it )
 				{
-					QStringList substyle = (*it).split(':', QString::SkipEmptyParts);
-					QString command(substyle[0].trimmed());
-					QString params(substyle[1].trimmed());
-					if( command == "stop-color" )
-						Col = parseColor(params);
-					if( command == "stop-opacity" )
-						opa = fromPercentage(params);
+					QStringList substyle = it->split(':', QString::SkipEmptyParts);
+					if (substyle.count() >= 2)
+					{
+						QString command(substyle.at(0).trimmed());
+						QString params(substyle.at(1).trimmed());
+						if( command == "stop-color" )
+							Col = parseColor(params);
+						if( command == "stop-opacity" )
+							opa = fromPercentage(params);
+					}
 				}
 			}
 		}




More information about the scribus-commit mailing list