r22304 by craig -

scribus-commit scribus-commit at lists.scribus.net
Fri Dec 29 23:01:30 UTC 2017


Author: craig
Date: Fri Dec 29 23:01:30 2017
New Revision: 22304

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22304
Log:
Fix Coverity 1350725

Modified:
    trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp

Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22304&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp	(original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp	Fri Dec 29 23:01:30 2017
@@ -17,7 +17,13 @@
 #include "scimgdataloader_wpg.h"
 #include "third_party/wpg/WPGStreamImplementation.h"
 
-ScrPainterIm::ScrPainterIm(): libwpg::WPGPaintInterface()
+ScrPainterIm::ScrPainterIm(): libwpg::WPGPaintInterface(),
+	fillrule(false),
+	gradientAngle(0.0),
+	isGradient(false),
+	fillSet(false),
+	strokeSet(false),
+	image(NULL)
 {
 }
 
@@ -124,7 +130,7 @@
 		currentGradient = QLinearGradient();
 		for(unsigned c = 0; c < brush.gradient.count(); c++)
 		{
-			QColor stopC = QColor(brush.gradient.stopColor(c).red, brush.gradient.stopColor(c).green, brush.gradient.stopColor(c).blue);
+			QColor stopC(brush.gradient.stopColor(c).red, brush.gradient.stopColor(c).green, brush.gradient.stopColor(c).blue);
 			double pos = qBound(0.0, fabs(brush.gradient.stopOffset(c)), 1.0);
 			currentGradient.setColorAt(pos, stopC);
 		}
@@ -147,7 +153,7 @@
 {
 	imagePainter.setBrush(currentBrush);
 	imagePainter.setPen(currentPen);
-	QRectF rr = QRectF(rect.x1 * 72, rect.y1 * 72, rect.width() * 72, rect.height() * 72);
+	QRectF rr(rect.x1 * 72, rect.y1 * 72, rect.width() * 72, rect.height() * 72);
 	if (isGradient)
 	{
 		QTransform m1;
@@ -168,7 +174,7 @@
 {
 	imagePainter.setBrush(currentBrush);
 	imagePainter.setPen(currentPen);
-	QRectF rr = QRectF(0, 0, rx * 144.0, ry * 144.0);
+	QRectF rr(0, 0, rx * 144.0, ry * 144.0);
 	if (isGradient)
 	{
 		QTransform m1;
@@ -197,7 +203,7 @@
 	}
 	if (isGradient)
 	{
-		QRectF rr = Coords.boundingRect();
+		QRectF rr(Coords.boundingRect());
 		QTransform m1;
 		m1.rotate(-gradientAngle);
 		currentGradient.setStart(rr.x(), rr.y());
@@ -241,7 +247,7 @@
 	{
 		if (isGradient)
 		{
-			QRectF rr = Coords.boundingRect();
+			QRectF rr(Coords.boundingRect());
 			QTransform m1;
 			m1.rotate(-gradientAngle);
 			currentGradient.setStart(rr.x(), rr.y());
@@ -264,7 +270,7 @@
 
 void ScrPainterIm::drawBitmap(const libwpg::WPGBitmap& bitmap, double hres, double vres)
 {
-	QImage img = QImage(bitmap.width(), bitmap.height(), QImage::Format_RGB32);
+	QImage img(bitmap.width(), bitmap.height(), QImage::Format_RGB32);
 	for(int x = 0; x < bitmap.width(); x++)
 	{
 		for(int y = 0; y < bitmap.height(); y++)




More information about the scribus-commit mailing list