r15816 by jghali - #9479 : crash importing SVG file into scribus
scribus-commit
scribus-commit at lists.scribus.net
Mon Nov 8 20:39:12 CET 2010
Author: jghali
Date: Mon Nov 8 19:39:12 2010
New Revision: 15816
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=15816
Log:
#9479 : crash importing SVG file into scribus
Modified:
trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=15816&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Mon Nov 8 19:39:12 2010
@@ -2670,10 +2670,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;
}
@@ -2714,13 +2717,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