r22630 by craig - clazy and clang fixes, part 12

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 14 19:38:29 UTC 2018


Author: craig
Date: Tue Aug 14 19:38:29 2018
New Revision: 22630

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22630
Log:
clazy and clang fixes, part 12

Modified:
    trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
    trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
    trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.h
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
    trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
    trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
    trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
    trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
    trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
    trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
    trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp
    trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
    trunk/Scribus/scribus/pp_proxy.cpp

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp	Tue Aug 14 19:38:29 2018
@@ -53,8 +53,8 @@
 
 MeshDistortionPlugin::MeshDistortionPlugin() : ScActionPlugin()
 {
-	m_doc = 0;
-	m_patternItem = 0;
+	m_doc = nullptr;
+	m_patternItem = nullptr;
 	// Set action info in languageChange, so we only have to do
 	// it in one place.
 	languageChange();
@@ -116,7 +116,7 @@
 bool MeshDistortionPlugin::run(ScribusDoc* doc, QString)
 {
 	m_doc = doc;
-	if (m_doc == 0)
+	if (m_doc == nullptr)
 		m_doc = ScCore->primaryMainWindow()->doc;
 	if (m_doc->m_Selection->count() > 0)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp	Tue Aug 14 19:38:29 2018
@@ -128,7 +128,7 @@
 	buttonZoomOut->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-out.png")));
 	buttonZoomIn->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-in.png")));
 	m_doc = doc;
-	addItemsToScene(doc->m_Selection, doc, 0, 0);
+	addItemsToScene(doc->m_Selection, doc, nullptr, nullptr);
 	for(unsigned dim = 0; dim < 2; dim++)
 	{
 		sb2[dim].us = 2;
@@ -208,7 +208,7 @@
 	itemSelection->setGroupRect();
 	itemSelection->getGroupRect(&gx, &gy, &gw, &gh);
 	uint selectedItemCount = itemSelection->count();
-	if (parentItem == 0)
+	if (parentItem == nullptr)
 	{
 		w4 = qMax(gw, gh) / 2.0;
 		w2 = qMax(gw, gh);
@@ -228,7 +228,7 @@
 		else
 			pp = path.toQPainterPath(true);
 		QGraphicsPathItem* pItem = new QGraphicsPathItem(pp, parentItem);
-		if (parentItem == 0)
+		if (parentItem == nullptr)
 		{
 			scene.addItem(pItem);
 			pItem->setPos(currItem->xPos() - gx + deltaX, currItem->yPos() - gy + deltaY);

Modified: trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp	Tue Aug 14 19:38:29 2018
@@ -55,12 +55,12 @@
 }
 
 PathAlongPathPlugin::PathAlongPathPlugin() : ScActionPlugin(),
-	patternItem(0),
-	pathItem(0),
+	patternItem(nullptr),
+	pathItem(nullptr),
 	originalRot(0.0),
 	originalXPos(0.0),
 	originalYPos(0.0),
-	m_doc(0),
+	m_doc(nullptr),
 	firstUpdate(false),
 	m_scaling(0.0),
 	nbCopies(0),
@@ -176,7 +176,7 @@
 	originalXPosG.clear();
 	originalYPosG.clear();
 	patternItemG.clear();
-	if (m_doc == 0)
+	if (m_doc == nullptr)
 		m_doc = ScCore->primaryMainWindow()->doc;
 	if (m_doc->m_Selection->count() > 1)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp	Tue Aug 14 19:38:29 2018
@@ -116,7 +116,7 @@
 bool FlattenPathPlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 0)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp	Tue Aug 14 19:38:29 2018
@@ -29,9 +29,9 @@
 	m_returnToDefaultLang=false;
 	m_primaryLangIndex=0;
 
-	m_dictionaryMap = 0;
-	m_hspellerMap = 0;
-	m_wfList = 0;
+	m_dictionaryMap = nullptr;
+	m_hspellerMap = nullptr;
+	m_wfList = nullptr;
 	m_wfListIndex = 0;
 }
 

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.cpp	Tue Aug 14 19:38:29 2018
@@ -15,8 +15,8 @@
 
 HunspellDict::HunspellDict(const QString& affPath, const QString& dictPath)
 {
-	m_hunspell = 0;
-	m_codec = 0;
+	m_hunspell = nullptr;
+	m_codec = nullptr;
 
 	QString encoding = "ISO8859-1";
 	m_hunspell = new Hunspell(affPath.toLocal8Bit().constData(), dictPath.toLocal8Bit().constData());
@@ -34,11 +34,8 @@
 
 HunspellDict::~HunspellDict()
 {
-	if (m_hunspell)
-	{
-		delete m_hunspell;
-		m_hunspell = 0;
-	}
+	delete m_hunspell;
+	m_hunspell = nullptr;
 }
 
 #ifndef HUNSPELL_NEWAPI
@@ -62,7 +59,7 @@
 	return replacements;
 }
 #else
-int HunspellDict::spell(QString word)
+int HunspellDict::spell(const QString& word)
 {
 	if (!m_hunspell)
 		return -1;

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.h
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.h	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldict.h	Tue Aug 14 19:38:29 2018
@@ -20,7 +20,7 @@
 	HunspellDict(const QString& affPath, const QString& dictPath);
 	~HunspellDict();
 
-	int spell(QString word);
+	int spell(const QString& word);
 	QStringList suggest(QString word);
 
 protected:

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellpluginimpl.cpp	Tue Aug 14 19:38:29 2018
@@ -31,7 +31,7 @@
 
 
 // Initialize members here, if any
-HunspellPluginImpl::HunspellPluginImpl() : QObject(0)
+HunspellPluginImpl::HunspellPluginImpl() : QObject(nullptr)
 {
 //	numDicts=0;
 	m_doc=nullptr;

Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp	Tue Aug 14 19:38:29 2018
@@ -255,7 +255,7 @@
 	setModal(true);
 	buttonZoomOut->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-out.png")));
 	buttonZoomI->setIcon(QIcon(IconManager::instance()->loadIcon("16/zoom-in.png")));
-	addItemsToScene(doc->m_Selection, doc, 0, 0);
+	addItemsToScene(doc->m_Selection, doc, nullptr, nullptr);
 	previewWidget->setRenderHint(QPainter::Antialiasing);
 	previewWidget->setScene(&scene);
 	isFirst = true;
@@ -294,7 +294,7 @@
 			pp = path.toQPainterPath(true);
 		origPath.append(pp);
 		QGraphicsPathItem* pItem = new QGraphicsPathItem(pp, parentItem);
-		if (parentItem == 0)
+		if (parentItem == nullptr)
 		{
 			scene.addItem(pItem);
 			pItem->setPos(currItem->xPos() - gx, currItem->yPos() - gy);

Modified: trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp	Tue Aug 14 19:38:29 2018
@@ -111,7 +111,7 @@
 bool LensEffectsPlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 0)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp	Tue Aug 14 19:38:29 2018
@@ -51,9 +51,9 @@
 }
 
 PathConnectPlugin::PathConnectPlugin() : ScActionPlugin(),
-	m_item1(0),
-	m_item2(0),
-	m_doc(0),
+	m_item1(nullptr),
+	m_item2(nullptr),
+	m_doc(nullptr),
 	originalXPos(0.0),
 	originalYPos(0.0),
 	firstUpdate(false)
@@ -121,7 +121,7 @@
 {
 	m_doc = doc;
 	firstUpdate = true;
-	if (m_doc == 0)
+	if (m_doc == nullptr)
 		m_doc = ScCore->primaryMainWindow()->doc;
 	if (m_doc->m_Selection->count() > 1)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp	Tue Aug 14 19:38:29 2018
@@ -128,7 +128,7 @@
 		return true;
 	}
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 1)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp	Tue Aug 14 19:38:29 2018
@@ -127,7 +127,7 @@
 bool PathFinderPlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() <= 1)
 		return true;

Modified: trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp	Tue Aug 14 19:38:29 2018
@@ -124,7 +124,7 @@
 bool PathStrokerPlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 0)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp	Tue Aug 14 19:38:29 2018
@@ -122,7 +122,7 @@
 bool SmoothPathPlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	if (currDoc->m_Selection->count() > 0)
 	{

Modified: trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp	Tue Aug 14 19:38:29 2018
@@ -106,7 +106,7 @@
 bool SubdividePlugin::run(ScribusDoc* doc, QString)
 {
 	ScribusDoc* currDoc = doc;
-	if (currDoc == 0)
+	if (currDoc == nullptr)
 		currDoc = ScCore->primaryMainWindow()->doc;
 	double nearT = 0.5;
 	uint docSelectionCount = currDoc->m_Selection->count();

Modified: trunk/Scribus/scribus/pp_proxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22630&path=/trunk/Scribus/scribus/pp_proxy.cpp
==============================================================================
--- trunk/Scribus/scribus/pp_proxy.cpp	(original)
+++ trunk/Scribus/scribus/pp_proxy.cpp	Tue Aug 14 19:38:29 2018
@@ -11,8 +11,8 @@
 
 PP_Proxy::PP_Proxy(QObject *parent)
 	: QObject(parent),
-	  m_pageItem(NULL),
-	  m_scribusDoc(NULL)
+	  m_pageItem(nullptr),
+	  m_scribusDoc(nullptr)
 {
 }
 




More information about the scribus-commit mailing list