r22325 by craig -

scribus-commit scribus-commit at lists.scribus.net
Mon Jan 1 17:16:57 UTC 2018


Author: craig
Date: Mon Jan  1 17:16:57 2018
New Revision: 22325

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

Modified:
    trunk/Scribus/scribus/ui/hruler.cpp
    trunk/Scribus/scribus/ui/hruler.h
    trunk/Scribus/scribus/ui/marginwidget.cpp
    trunk/Scribus/scribus/ui/marginwidget.h
    trunk/Scribus/scribus/ui/vruler.cpp
    trunk/Scribus/scribus/ui/vruler.h

Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/hruler.cpp	Mon Jan  1 17:16:57 2018
@@ -68,7 +68,34 @@
 };
 
 
-Hruler::Hruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa)
+Hruler::Hruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa),
+	textEditMode(false),
+	ColGap(0.0),
+	lineCorr(0.0),
+	Cols(0),
+	RExtra(0.0),
+	Extra(0.0),
+	Indent(0.0),
+	First(0.0),
+	RMargin(0.0),
+	Revers(false),
+	currItem(NULL),
+	ItemPos(0.0),
+	ItemEndPos(0.0),
+	offs(0.0),
+	itemScale(1.0),
+	Markp(0),
+	oldMark(0),
+	Mpressed(false),
+	ActCol(1),
+	ActTab(0),
+	Scaling(0.0),
+	RulerCode(rc_none),
+	MouseX(0),
+	m_doc(doc),
+	m_view(pa),
+	whereToDraw(0),
+	drawMark(false)
 {
 	prefsManager=PrefsManager::instance();
 	setBackgroundRole(QPalette::Window);
@@ -76,16 +103,6 @@
 	QPalette palette;
 	palette.setBrush(QPalette::Window, QColor(240, 240, 240));
 	setPalette(palette);
-	m_doc = doc;
-	m_view = pa;
-	offs = 0;
-	oldMark = 0;
-	ActCol = 1;
-	Mpressed = false;
-	textEditMode = false;
-	drawMark = false;
-	RulerCode = rc_none;
-	itemScale = 1.0;
 	setMouseTracking(true);
 	rulerGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
 	unitChange();
@@ -955,14 +972,14 @@
 			else
 			{
 				iter = unitRulerGetIter1FromIndex(docUnitIndex) / cor;
-	  			iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
-	  		}
+				iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
+			}
 			break;
 		case SC_MM:
 			if (sc > 1)
 				cor = 10;
 			iter = unitRulerGetIter1FromIndex(docUnitIndex) / cor;
-  			iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
+			iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
 			break;
 		case SC_IN:
 			iter = unitRulerGetIter1FromIndex(docUnitIndex);

Modified: trunk/Scribus/scribus/ui/hruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/hruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.h	(original)
+++ trunk/Scribus/scribus/ui/hruler.h	Mon Jan  1 17:16:57 2018
@@ -48,7 +48,7 @@
 
 public:
 	Hruler(ScribusView *pa, ScribusDoc *doc);
-	~Hruler() {};
+	~Hruler() {}
 private:
 	bool textEditMode;
 	double ColGap;

Modified: trunk/Scribus/scribus/ui/marginwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/marginwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/marginwidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/marginwidget.cpp	Mon Jan  1 17:16:57 2018
@@ -20,7 +20,9 @@
 
 
 MarginWidget::MarginWidget( QWidget* parent, QString /*title*/, const MarginStruct* margs, int unitIndex, bool showChangeAll, bool showBleeds) : QTabWidget(parent),
-pageType(0)
+	pageWidth(0.0),
+	pageHeight(0.0),
+	pageType(0)
 {
 	marginData=*margs;
 	savedMargins=*margs;
@@ -92,6 +94,7 @@
 	}
 	else
 	{
+		marginsForPagesLayout=NULL;
 		marginsForPages=NULL;
 		marginsForAllPages=NULL;
 		marginsForAllMasterPages=NULL;

Modified: trunk/Scribus/scribus/ui/marginwidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/marginwidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/marginwidget.h	(original)
+++ trunk/Scribus/scribus/ui/marginwidget.h	Mon Jan  1 17:16:57 2018
@@ -38,7 +38,7 @@
 	\param showChangeAll show "apply to all pages" related items
 	*/
 	MarginWidget( QWidget* parent, QString title, const MarginStruct* margs, int unitIndex, bool showChangeAll=false, bool showBleeds=true);
-	~MarginWidget() {};
+	~MarginWidget() {}
 	/*! \brief Setup the labels by facing pages option */
 	void setFacingPages(bool facing, int pagetype = 0);
 	/*! \brief Setup the spinboxes properties (min/max value etc.) by width and height */

Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/vruler.cpp	Mon Jan  1 17:16:57 2018
@@ -42,7 +42,14 @@
 #include "scribusview.h"
 #include "units.h"
 
-Vruler::Vruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa)
+Vruler::Vruler(ScribusView *pa, ScribusDoc *doc) : QWidget(pa),
+	offs(0.0),
+	oldMark(0),
+	Mpressed(false),
+	m_doc(doc),
+	m_view(pa),
+	drawMark(false),
+	whereToDraw(0)
 {
 	prefsManager=PrefsManager::instance();
 	setBackgroundRole(QPalette::Window);
@@ -50,13 +57,6 @@
 	QPalette palette;
 	palette.setBrush(QPalette::Window, QColor(240, 240, 240));
 	setPalette(palette);
-	m_doc = doc;
-	m_view = pa;
-	offs = 0;
-	oldMark = 0;
-	Mpressed = false;
-	drawMark = false;
-	whereToDraw = 0;
 	setMouseTracking(true);
 	rulerGesture = new RulerGesture(m_view, RulerGesture::VERTICAL);
 	unitChange();

Modified: trunk/Scribus/scribus/ui/vruler.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22325&path=/trunk/Scribus/scribus/ui/vruler.h
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.h	(original)
+++ trunk/Scribus/scribus/ui/vruler.h	Mon Jan  1 17:16:57 2018
@@ -43,11 +43,8 @@
 
 public:
 	Vruler(ScribusView *pa, ScribusDoc *doc);
-	~Vruler() {};
+	~Vruler() {}
 	
-	double offs;
-	int oldMark;
-	bool Mpressed;
 	double ruleSpacing();
 
 private: // Private attributes
@@ -57,7 +54,9 @@
 	virtual void mouseMoveEvent(QMouseEvent *m);
 
 	void drawNumber(QString num, int starty, QPainter *p);
-
+	double offs;
+	int oldMark;
+	bool Mpressed;
 	ScribusDoc *m_doc;
 	ScribusView *m_view;
 




More information about the scribus-commit mailing list