r24174 by jghali - #16312: fix creation of phantom color with empty color name caused by incorrect initialization of mask gradient

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 4 16:40:51 UTC 2020


Author: jghali
Date: Wed Nov  4 16:40:51 2020
New Revision: 24174

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24174
Log:
#16312: fix creation of phantom color with empty color name caused by incorrect initialization of mask gradient

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/vgradient.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24174&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Wed Nov  4 16:40:51 2020
@@ -641,6 +641,7 @@
 	}
 	GrMaskEndX = w;
 	mask_gradient = VGradient(VGradient::linear);
+	mask_gradient.clearStops();
 	const ScColor& col = m_Doc->PageColors["Black"];
 	QColor qcol = ScColorEngine::getRGBColor(col, m_Doc);
 	mask_gradient.addStop(qcol, 0.0, 0.5, 1.0, "Black", 100);

Modified: trunk/Scribus/scribus/vgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24174&path=/trunk/Scribus/scribus/vgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradient.cpp	(original)
+++ trunk/Scribus/scribus/vgradient.cpp	Wed Nov  4 16:40:51 2020
@@ -61,10 +61,10 @@
 	// set up dummy gradient
 	QColor color;
 
-	color = QColor(255,0,0);
+	color = QColor(255, 0, 0);
 	addStop( color, 0.0, 0.5, 1.0 );
 
-	color = QColor(255,255,0);
+	color = QColor(255, 255, 0);
 	addStop( color, 1.0, 0.5, 1.0 );
 
 	setOrigin( FPoint( 0, 0 ) );




More information about the scribus-commit mailing list