r20708 by fschmid -

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 24 11:09:48 UTC 2016


Author: fschmid
Date: Sun Jan 24 11:09:48 2016
New Revision: 20708

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20708
Log:
Part of #12305: Some SVG files not properly imported by Scribus
Fixed gradient stop with no color.

Modified:
    trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp

Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20708&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	Sun Jan 24 11:09:48 2016
@@ -2838,16 +2838,16 @@
 			}
 			else
 				offset = ScCLocale::toDoubleC(temp);
-			if( !stop.attribute( "stop-opacity" ).isEmpty() )
+			if (stop.hasAttribute( "stop-opacity" ))
 				opa = fromPercentage(stop.attribute("stop-opacity"));
-			if( !stop.attribute( "stop-color" ).isEmpty() )
+			if (stop.hasAttribute("stop-color"))
 			{
 				if (stop.attribute("stop-color") == "currentColor")
 					Col = svgStyle.CurCol;
 				else
 					Col = parseColor(stop.attribute("stop-color"));
 			}
-			else
+			else if (stop.hasAttribute("style"))
 			{
 				QString style = stop.attribute( "style" ).simplified();
 				QStringList substyles = style.split(';', QString::SkipEmptyParts);
@@ -2865,6 +2865,8 @@
 					}
 				}
 			}
+			else
+				Col = "Black";
 		}
 		const ScColor& gradC = m_Doc->PageColors[Col];
 		gradient->gradient.addStop( ScColorEngine::getRGBColor(gradC, m_Doc), offset, 0.5, opa, Col, 100 );




More information about the scribus-commit mailing list