r24527 by jghali - Fix a few places where ScPainter's setFillMode()/setStrokeMode() are called using an integer argument instead of proper enum value

scribus-commit scribus-commit at lists.scribus.net
Fri Feb 26 23:09:32 UTC 2021


Author: jghali
Date: Fri Feb 26 23:09:32 2021
New Revision: 24527

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24527
Log:
Fix a few places where ScPainter's setFillMode()/setStrokeMode() are called using an integer argument instead of proper enum value

Modified:
    trunk/Scribus/scribus/chartablemodel.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_pathtext.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/text/screenpainter.cpp
    trunk/Scribus/scribus/ui/arrowchooser.cpp
    trunk/Scribus/scribus/ui/charzoom.cpp
    trunk/Scribus/scribus/ui/colorsandfills.cpp
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/dasheditor.cpp
    trunk/Scribus/scribus/ui/gradientpreview.cpp
    trunk/Scribus/scribus/ui/transparencypalette.cpp

Modified: trunk/Scribus/scribus/chartablemodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/chartablemodel.cpp
==============================================================================
--- trunk/Scribus/scribus/chartablemodel.cpp	(original)
+++ trunk/Scribus/scribus/chartablemodel.cpp	Fri Feb 26 23:09:32 2021
@@ -91,7 +91,7 @@
 			gly.map(chma);
 			p->translate(ww / 2, 1);
 			p->setBrush(Qt::black);
-			p->setFillMode(1);
+			p->setFillMode(ScPainter::Solid);
 			p->setupPolygon(&gly);
 			p->fillPath();
 			p->end();

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.cpp	Fri Feb 26 23:09:32 2021
@@ -260,7 +260,7 @@
 	ymax = 0.0;
 	ScPainter *p = new ScPainter(&pm, pm.width(), pm.height());
 	p->clear(back);
-	p->setFillMode(1);
+	p->setFillMode(ScPainter::Solid);
 	p->setLineWidth(0.0);
 //	p->setBrush(back);
 //	p->drawRect(0.0, 0.0, static_cast<qreal>(w), static_cast<qreal>(h));

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Fri Feb 26 23:09:32 2021
@@ -1998,7 +1998,7 @@
 					p->setPen(PrefsManager::instance().appPrefs.displayPrefs.frameLinkColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 				if (m_Locked)
 					p->setPen(PrefsManager::instance().appPrefs.displayPrefs.frameLockColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-				p->setFillMode(0);
+				p->setFillMode(ScPainter::None);
 				if (itemType() == PathText)
 				{
 					if (Clip.count() != 0)

Modified: trunk/Scribus/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/pageitem_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_pathtext.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_pathtext.cpp	Fri Feb 26 23:09:32 2021
@@ -335,7 +335,7 @@
 	if (!m_Doc->RePos)
 	{
 		int fm = p->fillMode();
-		p->setFillMode(1);
+		p->setFillMode(ScPainter::Solid);
 		p->save();
 		ScreenPainter painter(p, this);
 		textLayout.render(&painter);

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Fri Feb 26 23:09:32 2021
@@ -3549,8 +3549,8 @@
 
 		int fm = p->fillMode();
 		int sm = p->strokeMode();
-		p->setFillMode(1);
-		p->setStrokeMode(1);
+		p->setFillMode(ScPainter::Solid);
+		p->setStrokeMode(ScPainter::Solid);
 		ScreenPainter painter(p, this);
 		textLayout.renderBackground(&painter);
 		textLayout.render(&painter, this);
@@ -3698,7 +3698,7 @@
 			if (m_Locked)
 				p->setPen(PrefsManager::instance().appPrefs.displayPrefs.frameLockColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 
-			p->setFillMode(0);
+			p->setFillMode(ScPainter::None);
 			p->setupSharpPolygon(&PoLine);
 			p->strokePath();
 		}

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp	(original)
+++ trunk/Scribus/scribus/scpageoutput.cpp	Fri Feb 26 23:09:32 2021
@@ -980,7 +980,7 @@
 		int fm = m_painter->fillMode();
 
 		m_painter->setFillRule(false);
-		m_painter->setFillMode(1);
+		m_painter->setFillMode(ScPainterExBase::Solid);
 
 		setupState();
 
@@ -1057,8 +1057,8 @@
 	{
 		m_painter->save();
 		setupState();
-		m_painter->setFillMode(1);
-		m_painter->setStrokeMode(1);
+		m_painter->setFillMode(ScPainterExBase::Solid);
+		m_painter->setStrokeMode(ScPainterExBase::Solid);
 		m_painter->drawRect(rect.x(), rect.y(), rect.width(), rect.height());
 		m_painter->restore();
 	}

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp	(original)
+++ trunk/Scribus/scribus/scpainter.cpp	Fri Feb 26 23:09:32 2021
@@ -1773,7 +1773,7 @@
 
 void ScPainter::drawShadeCircle(const QRectF &re, const QColor& color, bool sunken, int lineWidth)
 {
-	setStrokeMode(1);
+	setStrokeMode(ScPainter::Solid);
 	double bezierCircle = 0.55228475;
 	double dx = re.width();
 	double dy = re.height();

Modified: trunk/Scribus/scribus/text/screenpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/text/screenpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/text/screenpainter.cpp	(original)
+++ trunk/Scribus/scribus/text/screenpainter.cpp	Fri Feb 26 23:09:32 2021
@@ -208,7 +208,7 @@
 		if (stroke)
 		{
 			QColor tmp = m_painter->pen();
-			m_painter->setStrokeMode(1);
+			m_painter->setStrokeMode(ScPainter::Solid);
 			m_painter->setPen(m_painter->brush(), 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			m_painter->setLineWidth(fontSize() * gc.scaleV() / 20.0);
 			m_painter->strokePath();
@@ -216,7 +216,7 @@
 		}
 		else
 		{
-			m_painter->setFillMode(1);
+			m_painter->setFillMode(ScPainter::Solid);
 			m_painter->fillPath();
 		}
 		m_painter->setBrush(oldBrush);

Modified: trunk/Scribus/scribus/ui/arrowchooser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/arrowchooser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/arrowchooser.cpp	(original)
+++ trunk/Scribus/scribus/ui/arrowchooser.cpp	Fri Feb 26 23:09:32 2021
@@ -48,7 +48,7 @@
 //		painter->clear();
 		painter->setBrush(textColor);
 		painter->setPen(textColor, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		painter->setFillMode(1);
+		painter->setFillMode(ScPainter::Solid);
 		painter->translate(3.0, 3.0);
 		path.resize(0);
 		path = arrowStyles->at(i).points.copy();

Modified: trunk/Scribus/scribus/ui/charzoom.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/charzoom.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/charzoom.cpp	(original)
+++ trunk/Scribus/scribus/ui/charzoom.cpp	Fri Feb 26 23:09:32 2021
@@ -36,7 +36,7 @@
 		gly.map(chma);
 		p->translate(ww / 2, 1);
 		p->setBrush(Qt::black);
-		p->setFillMode(1);
+		p->setFillMode(ScPainter::Solid);
 		p->setupPolygon(&gly);
 		p->fillPath();
 		p->end();

Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp	(original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp	Fri Feb 26 23:09:32 2021
@@ -231,7 +231,7 @@
 		pb.end();
 		ScPainter *p = new ScPainter(&pixm, 48, 12);
 		p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		p->setFillMode(2);
+		p->setFillMode(ScPainter::Gradient);
 		p->fill_gradient = gr;
 		p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0, 0), 1.0, 0.0);
 		p->drawRect(0, 0, 48, 12);

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp	Fri Feb 26 23:09:32 2021
@@ -715,7 +715,7 @@
 		pb.end();
 		ScPainter *p = new ScPainter(&pixm, 48, 12);
 		p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		p->setFillMode(2);
+		p->setFillMode(ScPainter::Gradient);
 		p->fill_gradient = gr;
 		p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0,0), 1, 0);
 		p->drawRect(0, 0, 48, 12);

Modified: trunk/Scribus/scribus/ui/dasheditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/dasheditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dasheditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/dasheditor.cpp	Fri Feb 26 23:09:32 2021
@@ -68,7 +68,7 @@
 	p->clear(QColor(128, 128, 128));
 	double startX = 0.0;
 	p->setLineWidth(0);
-	p->setFillMode(1);
+	p->setFillMode(ScPainter::Solid);
 	p->setBrush(Qt::black);
 	for (int i = 0; i < m_dashValues.count(); i++)
 	{
@@ -83,7 +83,7 @@
 			m_stops.append(startX);
 	}
 	p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	p->setFillMode(0);
+	p->setFillMode(ScPainter::None);
 	p->drawRect(0, 0, pWidth, 10);
 	p->end();
 	delete p;

Modified: trunk/Scribus/scribus/ui/gradientpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/gradientpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientpreview.cpp	(original)
+++ trunk/Scribus/scribus/ui/gradientpreview.cpp	Fri Feb 26 23:09:32 2021
@@ -90,7 +90,7 @@
 	ScPainter *p = new ScPainter(&pixm, width() - 20, 37);
 //	p->clear(Qt::white);
 	p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-	p->setFillMode(2);
+	p->setFillMode(ScPainter::Gradient);
 	p->fill_gradient = fill_gradient;
 	p->setGradient(VGradient::linear, FPoint(0, 20), FPoint(width() - 20, 20), FPoint(0, 0), 1.0, 0.0);
 	p->drawRect(0, 0, width() - 20, 37);

Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24527&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp	Fri Feb 26 23:09:32 2021
@@ -247,7 +247,7 @@
 		pb.end();
 		ScPainter *p = new ScPainter(&pixm, 48, 12);
 		p->setPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		p->setFillMode(2);
+		p->setFillMode(ScPainter::Gradient);
 		p->fill_gradient = gr;
 		p->setGradient(VGradient::linear, FPoint(0,6), FPoint(48, 6), FPoint(0,0), 1, 0);
 		p->drawRect(0, 0, 48, 12);




More information about the scribus-commit mailing list