r22600 by craig - clazy and clang fixes, part 2

scribus-commit scribus-commit at lists.scribus.net
Sun Aug 5 07:21:32 UTC 2018


Author: craig
Date: Sun Aug  5 07:21:32 2018
New Revision: 22600

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

Modified:
    trunk/Scribus/scribus/gtaction.cpp
    trunk/Scribus/scribus/gtgettext.cpp
    trunk/Scribus/scribus/guidemanagercore.cpp
    trunk/Scribus/scribus/guidemanagercore.h
    trunk/Scribus/scribus/guidesdelegate.cpp
    trunk/Scribus/scribus/hyphenator.cpp
    trunk/Scribus/scribus/iconmanager.cpp
    trunk/Scribus/scribus/latexhelpers.cpp
    trunk/Scribus/scribus/loadsaveplugin.cpp
    trunk/Scribus/scribus/nodeeditcontext.cpp
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem_latexframe.cpp
    trunk/Scribus/scribus/pageitem_latexframe.h
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/pageitemiterator.cpp
    trunk/Scribus/scribus/palettes/cxfcolor.cpp
    trunk/Scribus/scribus/palettes/paletteloader.cpp
    trunk/Scribus/scribus/palettes/paletteloader_adobe_acb.cpp
    trunk/Scribus/scribus/palettes/paletteloader_adobe_aco.cpp
    trunk/Scribus/scribus/palettes/paletteloader_adobe_ase.cpp
    trunk/Scribus/scribus/palettes/paletteloader_cxf.cpp
    trunk/Scribus/scribus/palettes/paletteloader_swatchbook.cpp
    trunk/Scribus/scribus/pdf_analyzer.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/pdflib_core.h
    trunk/Scribus/scribus/pdfoptions.cpp
    trunk/Scribus/scribus/pluginmanager.cpp
    trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
    trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
    trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
    trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
    trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
    trunk/Scribus/scribus/undoobject.cpp
    trunk/Scribus/scribus/undoobject.h
    trunk/Scribus/scribus/updatemanager.cpp
    trunk/Scribus/scribus/upgradechecker.cpp
    trunk/Scribus/scribus/upgradechecker.h
    trunk/Scribus/scribus/urllauncher.cpp
    trunk/Scribus/scribus/urllauncher.h
    trunk/Scribus/scribus/util_file.cpp
    trunk/Scribus/scribus/util_formats.cpp
    trunk/Scribus/scribus/util_formats.h
    trunk/Scribus/scribus/util_printer.cpp
    trunk/Scribus/scribus/util_printer.h
    trunk/Scribus/scribus/util_text.cpp
    trunk/Scribus/scribus/util_text.h
    trunk/Scribus/scribus/vgradient.cpp
    trunk/Scribus/scribus/vgradientex.cpp

Modified: trunk/Scribus/scribus/gtaction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/gtaction.cpp
==============================================================================
--- trunk/Scribus/scribus/gtaction.cpp	(original)
+++ trunk/Scribus/scribus/gtaction.cpp	Sun Aug  5 07:21:32 2018
@@ -123,10 +123,10 @@
 		{
 			if (UndoManager::undoEnabled())
 				activeTransaction = m_undoManager->beginTransaction(Um::Selection, Um::IGroup, Um::ImportText, "", Um::IDelete);
-			if (m_it->nextInChain() != 0)
+			if (m_it->nextInChain() != nullptr)
 			{
 				PageItem *nextItem = m_it->nextInChain();
-				while (nextItem != 0)
+				while (nextItem != nullptr)
 				{
 					nextItem->itemText.selectAll();
 					nextItem->asTextFrame()->deleteSelectedTextFromFrame();
@@ -227,10 +227,10 @@
 	{
 		if (!m_doAppend)
 		{
-			if (m_it->nextInChain() != 0)
+			if (m_it->nextInChain() != nullptr)
 			{
 				PageItem *nextItem = m_it->nextInChain();
-				while (nextItem != 0)
+				while (nextItem != nullptr)
 				{
 					nextItem->itemText.clear();
 					nextItem = nextItem->nextInChain();
@@ -743,7 +743,7 @@
 			{
 				if (!m_prefsManager->appPrefs.fontPrefs.GFontSub.contains(font->getName()))
 				{
-					MissingFont *dia = new MissingFont(0, useFont, m_textFrame->doc());
+					MissingFont *dia = new MissingFont(nullptr, useFont, m_textFrame->doc());
 					dia->exec();
 					useFont = dia->getReplacementFont();
 					m_prefsManager->appPrefs.fontPrefs.GFontSub[font->getName()] = useFont;

Modified: trunk/Scribus/scribus/gtgettext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/gtgettext.cpp
==============================================================================
--- trunk/Scribus/scribus/gtgettext.cpp	(original)
+++ trunk/Scribus/scribus/gtgettext.cpp	Sun Aug  5 07:21:32 2018
@@ -96,12 +96,12 @@
 	
 	// If the targetframe is 0 ( no frame selected/created? ) then reassign it to the 
 	// (questionable interpretation here) first frame in the documentation.
-	if (targetFrame==0)
+	if (targetFrame==nullptr)
 		targetFrame=m_Doc->m_Selection->itemAt(0);
 
 	// If the targetframe is not zero, and we do need to call the importer, 
 	// Run the importer via "CallDLL" and pass it what it needs to know.
-	if (targetFrame!=0 && callImporter)
+	if (targetFrame!=nullptr && callImporter)
 		CallDLL(ida, filename, encoding, textOnly, append, prefix, targetFrame);
 }  //void gtGetText::launchImporter(int importer, const QString& filename, bool textOnly, 
    //						const QString& encoding, bool append, PageItem* target)

Modified: trunk/Scribus/scribus/guidemanagercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/guidemanagercore.cpp
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.cpp	(original)
+++ trunk/Scribus/scribus/guidemanagercore.cpp	Sun Aug  5 07:21:32 2018
@@ -25,7 +25,7 @@
 GuideManagerCore::GuideManagerCore():
 	gx(0), gy(0), gw(0), gh(0),
 	m_undoManager(UndoManager::instance()),
-	m_page(0),
+	m_page(nullptr),
 	m_horizontalAutoGap(0.0),
 	m_verticalAutoGap(0.0),
 	m_horizontalAutoCount(0),
@@ -75,7 +75,7 @@
 				m_horizontalStdG.append(value);
 				if (UndoManager::undoEnabled())
 				{
-					SimpleState* ss = new SimpleState(Um::AddHGuide, 0, Um::IGuides);
+					SimpleState* ss = new SimpleState(Um::AddHGuide, nullptr, Um::IGuides);
 					ss->set("ADD_H", value);
 					m_undoManager->action(m_page, ss);
 				}
@@ -116,7 +116,7 @@
 				m_verticalStdG.append(value);
 				if (UndoManager::undoEnabled())
 				{
-					SimpleState* ss = new SimpleState(Um::AddVGuide, 0, Um::IGuides);
+					SimpleState* ss = new SimpleState(Um::AddVGuide, nullptr, Um::IGuides);
 					ss->set("ADD_V", value);
 					m_undoManager->action(m_page, ss);
 				}
@@ -155,7 +155,7 @@
 			m_horizontalStdG.removeAt(m_horizontalStdG.indexOf(value));
 			if (UndoManager::undoEnabled())
 			{
-				SimpleState* ss = new SimpleState(Um::DelHGuide, 0, Um::IGuides);
+				SimpleState* ss = new SimpleState(Um::DelHGuide, nullptr, Um::IGuides);
 				ss->set("REMOVE_H", value);
 				m_undoManager->action(m_page, ss);
 			}
@@ -173,7 +173,7 @@
 			m_verticalStdG.removeAt(m_verticalStdG.indexOf(value));
 			if (UndoManager::undoEnabled())
 			{
-				SimpleState* ss = new SimpleState(Um::DelVGuide, 0, Um::IGuides);
+				SimpleState* ss = new SimpleState(Um::DelVGuide, nullptr, Um::IGuides);
 				ss->set("REMOVE_V", value);
 				m_undoManager->action(m_page, ss);
 			}
@@ -341,7 +341,7 @@
 			{
 				for (int i = 0; i < m_horizontalStdG.count(); ++i)
 				{
-					SimpleState* ss = new SimpleState(Um::DelHGuide, 0, Um::IGuides);
+					SimpleState* ss = new SimpleState(Um::DelHGuide, nullptr, Um::IGuides);
 					ss->set("REMOVE_H", m_horizontalStdG[i]);
 					m_undoManager->action(m_page, ss);
 				}
@@ -351,7 +351,7 @@
 		case Auto:
 			if (m_undoManager->undoEnabled())
 			{
-				SimpleState * ss = new SimpleState(Um::DelHAGuide, 0, Um::IGuides);
+				SimpleState * ss = new SimpleState(Um::DelHAGuide, nullptr, Um::IGuides);
 				ss->set("REMOVE_HA_GAP", m_horizontalAutoGap);
 				ss->set("REMOVE_HA_COUNT", m_horizontalAutoCount);
 				ss->set("REMOVE_HA_REFER", m_horizontalAutoRefer);
@@ -375,7 +375,7 @@
 			{
 				for (int i = 0; i < m_verticalStdG.count(); ++i)
 				{
-					SimpleState* ss = new SimpleState(Um::DelVGuide, 0, Um::IGuides);
+					SimpleState* ss = new SimpleState(Um::DelVGuide, nullptr, Um::IGuides);
 					ss->set("REMOVE_V", m_verticalStdG[i]);
 					m_undoManager->action(m_page, ss);
 				}
@@ -385,7 +385,7 @@
 		case Auto:
 			if (m_undoManager->undoEnabled())
 			{
-				SimpleState * ss = new SimpleState(Um::DelVAGuide, 0, Um::IGuides);
+				SimpleState * ss = new SimpleState(Um::DelVAGuide, nullptr, Um::IGuides);
 				ss->set("REMOVE_VA_GAP", m_verticalAutoGap);
 				ss->set("REMOVE_VA_COUNT", m_verticalAutoCount);
 				ss->set("REMOVE_VA_REFER", m_verticalAutoRefer);
@@ -408,7 +408,7 @@
 			m_horizontalStdG.append(to);
 			if (UndoManager::undoEnabled())
 			{
-				SimpleState* ss = new SimpleState(Um::MoveHGuide, 0, Um::IGuides);
+				SimpleState* ss = new SimpleState(Um::MoveHGuide, nullptr, Um::IGuides);
 				ss->set("MOVE_H_FROM", from);
 				ss->set("MOVE_H_TO", to);
 				m_undoManager->action(m_page, ss);
@@ -428,7 +428,7 @@
 			m_verticalStdG.append(to);
 			if (UndoManager::undoEnabled())
 			{
-				SimpleState* ss = new SimpleState(Um::MoveVGuide, 0, Um::IGuides);
+				SimpleState* ss = new SimpleState(Um::MoveVGuide, nullptr, Um::IGuides);
 				ss->set("MOVE_V_FROM", from);
 				ss->set("MOVE_V_TO", to);
 				m_undoManager->action(m_page, ss);
@@ -737,7 +737,7 @@
 	return QString("%1 %2 %3 %4").arg(page->guides.gx).arg(page->guides.gy).arg(page->guides.gw).arg(page->guides.gh);
 }
 
-void GuideManagerIO::readSelection(const QString guideString, ScPage *page)
+void GuideManagerIO::readSelection(const QString& guideString, ScPage *page)
 {
 	if (guideString.isEmpty())
 		return;

Modified: trunk/Scribus/scribus/guidemanagercore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/guidemanagercore.h
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.h	(original)
+++ trunk/Scribus/scribus/guidemanagercore.h	Sun Aug  5 07:21:32 2018
@@ -171,7 +171,7 @@
 		static QString writeHorizontalGuides(ScPage *page, GuideManagerCore::GuideType type);
 		static QString writeVerticalGuides(ScPage *page, GuideManagerCore::GuideType type);
 
-		static void readSelection(const QString guideString, ScPage *page);
+		static void readSelection(const QString& guideString, ScPage *page);
 		static QString writeSelection(ScPage *page);
 };
 

Modified: trunk/Scribus/scribus/guidesdelegate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/guidesdelegate.cpp
==============================================================================
--- trunk/Scribus/scribus/guidesdelegate.cpp	(original)
+++ trunk/Scribus/scribus/guidesdelegate.cpp	Sun Aug  5 07:21:32 2018
@@ -14,7 +14,7 @@
 
 GuidesDelegate::GuidesDelegate(QObject *parent)
 	: QItemDelegate(parent),
-		m_doc(0)
+		m_doc(nullptr)
 {
 }
 
@@ -29,17 +29,14 @@
 // 	return editor;
 // }
 
-void GuidesDelegate::setEditorData(QWidget *editor,
-								   const QModelIndex &index) const
+void GuidesDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
 {
 	double value = index.model()->data(index, Qt::EditRole).toDouble();
 	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
 	w->setValue(value);
 }
 
-void GuidesDelegate::setModelData(QWidget *editor,
-								  QAbstractItemModel *model,
-								  const QModelIndex &index) const
+void GuidesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
 {
 	ScrSpinBox *w = static_cast<ScrSpinBox*>(editor);
 	// When user exit widget, editor value may not be committed at this point
@@ -48,9 +45,7 @@
 	model->setData(index, value, Qt::EditRole);
 }
 
-void GuidesDelegate::updateEditorGeometry(QWidget *editor,
-										  const QStyleOptionViewItem &option,
-										  const QModelIndex &/* index */) const
+void GuidesDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const
 {
 	editor->setGeometry(option.rect);
 }
@@ -68,20 +63,13 @@
 {
 }
 
-QWidget * GuidesHDelegate::createEditor(QWidget *parent,
-									   const QStyleOptionViewItem &/* option */,
-									   const QModelIndex &/* index */) const
+QWidget * GuidesHDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex &/* index */) const
 {
-	Q_ASSERT_X(m_doc != 0, "GuidesHDelegate::createEditor",
-			   "No reference to the doc");
+	Q_ASSERT_X(m_doc != nullptr, "GuidesHDelegate::createEditor", "No reference to the doc");
 	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
 	double min = 0.0 - (m_doc->bleeds()->top() * uix);
-	double max = (m_doc->currentPage()->height() * uix)
-				 + (m_doc->bleeds()->bottom() * uix);
-	ScrSpinBox *editor =
-			new ScrSpinBox(min,
-						   max,
-						   parent, m_doc->unitIndex());
+	double max = (m_doc->currentPage()->height() * uix) + (m_doc->bleeds()->bottom() * uix);
+	ScrSpinBox *editor = new ScrSpinBox(min, max, parent, m_doc->unitIndex());
 	return editor;
 }
 
@@ -92,19 +80,12 @@
 {
 }
 
-QWidget * GuidesVDelegate::createEditor(QWidget *parent,
-									   const QStyleOptionViewItem &/* option */,
-									   const QModelIndex &/* index */) const
+QWidget * GuidesVDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &/* option */, const QModelIndex &/* index */) const
 {
-	Q_ASSERT_X(m_doc != 0, "GuidesVDelegate::createEditor",
-			   "No reference to the doc");
+	Q_ASSERT_X(m_doc != nullptr, "GuidesVDelegate::createEditor", "No reference to the doc");
 	double uix = unitGetRatioFromIndex(m_doc->unitIndex());
 	double min = 0.0 - (m_doc->bleeds()->left() * uix);
-	double max = (m_doc->currentPage()->width() * uix)
-				 + (m_doc->bleeds()->right() * uix);
-	ScrSpinBox *editor =
-			new ScrSpinBox(min,
-						   max,
-						   parent, m_doc->unitIndex());
+	double max = (m_doc->currentPage()->width() * uix) + (m_doc->bleeds()->right() * uix);
+	ScrSpinBox *editor = new ScrSpinBox(min, max, parent, m_doc->unitIndex());
 	return editor;
 }

Modified: trunk/Scribus/scribus/hyphenator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/hyphenator.cpp
==============================================================================
--- trunk/Scribus/scribus/hyphenator.cpp	(original)
+++ trunk/Scribus/scribus/hyphenator.cpp	Sun Aug  5 07:21:32 2018
@@ -77,14 +77,11 @@
 			file.close();
 			return true;
 		}
-		else
-		{
-			m_hdict = nullptr;
-			return false;
-		}
-	}
-
-	return (m_codec != 0 && m_hdict != 0);
+		m_hdict = nullptr;
+		return false;
+	}
+
+	return (m_codec != nullptr && m_hdict != nullptr);
 }
 
 void Hyphenator::slotNewSettings(bool Autom, bool ACheck)
@@ -344,12 +341,11 @@
 		return;
 
 	if (it->itemText.lengthOfSelection() > 0)
-	{
 		it->itemText.hyphenateWord(it->itemText.startOfSelection(), it->itemText.lengthOfSelection(), nullptr);
-	}
-	else {
-		uint a = it->itemText.length();
-		it->itemText.hyphenateWord(0, a, nullptr);
+	else
+	{
+		int i = it->itemText.length();
+		it->itemText.hyphenateWord(0, i, nullptr);
 	}
 	m_doc->DoDrawing = true;
 }

Modified: trunk/Scribus/scribus/iconmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/iconmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/iconmanager.cpp	(original)
+++ trunk/Scribus/scribus/iconmanager.cpp	Sun Aug  5 07:21:32 2018
@@ -24,7 +24,7 @@
 #include "prefsmanager.h"
 #include "scpaths.h"
 
-IconManager* IconManager::m_instance = 0;
+IconManager* IconManager::m_instance = nullptr;
 
 IconManager::IconManager(QObject *parent)
  : QObject(parent)
@@ -37,7 +37,7 @@
 
 IconManager* IconManager::instance()
 {
-	if (m_instance == 0)
+	if (m_instance == nullptr)
 		m_instance = new IconManager();
 
 	return m_instance;
@@ -47,7 +47,7 @@
 {
 	if (m_instance)
 		delete m_instance;
-	m_instance = 0;
+	m_instance = nullptr;
 }
 
 bool IconManager::setup()

Modified: trunk/Scribus/scribus/latexhelpers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/latexhelpers.cpp
==============================================================================
--- trunk/Scribus/scribus/latexhelpers.cpp	(original)
+++ trunk/Scribus/scribus/latexhelpers.cpp	Sun Aug  5 07:21:32 2018
@@ -35,7 +35,7 @@
 LatexHighlighter::LatexHighlighter(QTextDocument *document)
 	: QSyntaxHighlighter(document)
 {
-	m_rules = 0;
+	m_rules = nullptr;
 }
 
 void LatexHighlighter::highlightBlock(const QString &text)
@@ -101,7 +101,7 @@
 	QFile f(fn);
 	if (!f.open(QIODevice::ReadOnly))
 	{
-		ScMessageBox::critical(0, QObject::tr("Error"), "<qt>" + 
+		ScMessageBox::critical(nullptr, QObject::tr("Error"), "<qt>" +
 				QObject::tr("Opening the configfile %1 failed! %2").arg(
 						fn, f.errorString())
 				+ "</qt>");
@@ -394,7 +394,7 @@
 	return result;
 }
 
-LatexConfigCache* LatexConfigCache::m_instance = 0;
+LatexConfigCache* LatexConfigCache::m_instance = nullptr;
 
 LatexConfigCache* LatexConfigCache::instance()
 {
@@ -428,7 +428,7 @@
 	m_error[filename] = hasError;
 	if (hasError)
 	{
-		ScMessageBox::critical(0, QObject::tr("Error"), "<qt>" + 
+		ScMessageBox::critical(nullptr, QObject::tr("Error"), "<qt>" +
 				QObject::tr("Parsing the configfile %1 failed! Depending on the type of the error "
 						"render frames might not work correctly!\n%2").arg(
 						filename, parser->error())

Modified: trunk/Scribus/scribus/loadsaveplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/loadsaveplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/loadsaveplugin.cpp	(original)
+++ trunk/Scribus/scribus/loadsaveplugin.cpp	Sun Aug  5 07:21:32 2018
@@ -370,7 +370,7 @@
 	QList<FileFormat>::iterator itEnd(formats.end());
 	for ( ; it != itEnd ; ++it)
 	{
-		if ((it->formatId == id) && ((plug == 0) || (plug == it->plug)))
+		if ((it->formatId == id) && ((plug == nullptr) || (plug == it->plug)))
 			return it;
 	}
 	return itEnd;
@@ -382,7 +382,7 @@
 	QList<FileFormat>::iterator itEnd(formats.end());
 	for ( ; it != itEnd ; ++it)
 	{
-		if ((it->fileExtensions.contains(extension.toLower())) && ((plug == 0) || (plug == it->plug)) )
+		if ((it->fileExtensions.contains(extension.toLower())) && ((plug == nullptr) || (plug == it->plug)) )
 			return it;
 	}
 	return itEnd;
@@ -482,7 +482,7 @@
 	colorReading(false),
 	nativeScribus(false),
 	priority(0),
-	plug(0)
+	plug(nullptr)
 {
 }
 

Modified: trunk/Scribus/scribus/nodeeditcontext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/nodeeditcontext.cpp
==============================================================================
--- trunk/Scribus/scribus/nodeeditcontext.cpp	(original)
+++ trunk/Scribus/scribus/nodeeditcontext.cpp	Sun Aug  5 07:21:32 2018
@@ -113,7 +113,7 @@
 		
 		nodeTransaction.reset();
 		delete oldClip;
-		oldClip = 0;
+		oldClip = nullptr;
 	}
 }
 
@@ -142,7 +142,7 @@
 		else
 		{
 			delete oldClip;
-			oldClip = 0;
+			oldClip = nullptr;
 			nodeTransaction.cancel();
 		}
 	}
@@ -165,7 +165,7 @@
 	nodeTransaction.commit();
 	nodeTransaction.reset();
 	delete oldClip;
-	oldClip = 0;				
+	oldClip = nullptr;
 }	
 	
 
@@ -393,7 +393,7 @@
 		undoManager->action(currItem, state);
 	}
 	delete oldClip;
-	oldClip = 0;
+	oldClip = nullptr;
 }	
 
 
@@ -493,7 +493,7 @@
 		undoManager->action(currItem, state);
 	}
 	delete oldClip;
-	oldClip = 0;
-	
-}
-
+	oldClip = nullptr;
+	
+}
+

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Sun Aug  5 07:21:32 2018
@@ -1197,13 +1197,13 @@
 	if (frameOverflows() && NextBox)
 	{ // text ending in some next frame
 		LastBox = NextBox;
-		while (LastBox != 0 && !LastBox->frameDisplays(itemText.length()-1))
+		while (LastBox != nullptr && !LastBox->frameDisplays(itemText.length()-1))
 			LastBox = LastBox->nextInChain();
 	}
 	else if (frameUnderflows() && BackBox)
 	{ //text ending in some previous frame
 		LastBox = BackBox;
-		while (LastBox != 0 && !LastBox->frameDisplays(itemText.length()-1))
+		while (LastBox != nullptr && !LastBox->frameDisplays(itemText.length()-1))
 			LastBox = LastBox->prevInChain();
 	}
 	return LastBox;
@@ -1586,8 +1586,7 @@
 	// Note: cursor position can be past last characters, don't use frameDisplays() here
 	if (cursorPosition >= 0 && cursorPosition <= itemText.length())
 		return const_cast<ParagraphStyle&>(itemText.paragraphStyle(cursorPosition));
-	else
-		return const_cast<ParagraphStyle&>(itemText.defaultStyle());
+	return const_cast<ParagraphStyle&>(itemText.defaultStyle());
 }
 
 /// returns the style at the current charpos
@@ -1603,8 +1602,7 @@
 	// Note: cursor position can be past last characters, don't use frameDisplays() here
 	if (cursorPosition >= 0 && cursorPosition <= itemText.length())
 		return itemText.charStyle(cursorPosition);
-	else
-		return itemText.defaultStyle().charStyle();
+	return itemText.defaultStyle().charStyle();
 }
 
 void PageItem::currentTextProps(ParagraphStyle& parStyle) const
@@ -2201,7 +2199,7 @@
 				p->strokePath();
 			}
 		}
-		if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (ContourLine.size() != 0))
+		if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (!ContourLine.empty()))
 		{
 			p->setPen(Qt::darkGray, 0, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
 			p->setupSharpPolygon(&ContourLine);
@@ -9819,7 +9817,7 @@
 		m_imageXOffset = imgXOffs;
 		m_imageYOffset = imgYOffs;
 	}
-	if (imageClip.size() != 0)
+	if (!imageClip.empty())
 	{
 		imageClip = pixm.imgInfo.PDSpathData[pixm.imgInfo.usedPath].copy();
 		QTransform cl;
@@ -10170,7 +10168,7 @@
 	else
 		dY=newY;
 	moveImageXYOffsetBy(dX, dY);
-	if (imageClip.size() != 0)
+	if (!imageClip.empty())
 	{
 		imageClip = pixm.imgInfo.PDSpathData[pixm.imgInfo.usedPath].copy();
 		QTransform cl;

Modified: trunk/Scribus/scribus/pageitem_latexframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pageitem_latexframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_latexframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_latexframe.cpp	Sun Aug  5 07:21:32 2018
@@ -50,15 +50,15 @@
 	m_imgValid = false;
 	m_usePreamble = true;
 	m_err = 0;
-	internalEditor = 0;
+	internalEditor = nullptr;
 	m_killed = false;
 	
-	config = 0;
+	config = nullptr;
 	if (PrefsManager::instance()->latexConfigs().count() > 0)
 		setConfigFile(PrefsManager::instance()->latexConfigs()[0]);
 
 	latex = new QProcess();
-	connect(latex, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(updateImage(int, QProcess::ExitStatus)));
+	connect(latex, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(updateImage(int,QProcess::ExitStatus)));
 	connect(latex, SIGNAL(error(QProcess::ProcessError)), this, SLOT(latexError(QProcess::ProcessError)));
 	latex->setProcessChannelMode(QProcess::MergedChannels);
 	
@@ -80,14 +80,16 @@
 
 PageItem_LatexFrame::~PageItem_LatexFrame()
 {
-	if (internalEditor) delete internalEditor;
+	delete internalEditor;
 	
 	latex->disconnect();
-	if (latex->state() != QProcess::NotRunning) {
+	if (latex->state() != QProcess::NotRunning)
+	{
 		m_killed = true;
 		latex->terminate();
 		latex->waitForFinished(500);
-		if (latex->state() != QProcess::NotRunning) {
+		if (latex->state() != QProcess::NotRunning)
+		{
 			latex->kill();
 			latex->waitForFinished(500);
 		}
@@ -195,10 +197,7 @@
 		update(); //Show error marker
 		return;
 	}
-	else
-	{
-		firstWarning = true;
-	}
+	firstWarning = true;
 	m_imgValid = true;
 
 	//Save state and restore afterwards
@@ -254,7 +253,7 @@
 		update(); //Show error marker
 		if (firstWarningTmpfile)
 		{
-			ScMessageBox::critical(0, tr("Error"), "<qt>" +
+			ScMessageBox::critical(nullptr, tr("Error"), "<qt>" +
 								  tr("Could not create a temporary file to run the application!") 
 								  + "</qt>");
 			firstWarningTmpfile = false;
@@ -263,18 +262,16 @@
 		//Don't know how to continue as it's impossible to create tempfile
 		return;
 	}
-	else
-	{
-		firstWarningTmpfile = true;
-	}
+	firstWarningTmpfile = true;
 	
 	QString full_command = config->executable();
-	if (full_command.isEmpty()) {
+	if (full_command.isEmpty())
+	{
 		m_err = 0xffff;
 		update(); //Show error marker
 		if (firstWarningLatexMissing)
 		{
-			ScMessageBox::critical(0, tr("Error"),
+			ScMessageBox::critical(nullptr, tr("Error"),
 									 "<qt>" + tr("The config file didn't specify a executable path!") +
 									 "</qt>");
 			firstWarningLatexMissing = false;
@@ -282,17 +279,14 @@
         qCritical() << "RENDER FRAME:" << tr("The config file didn't specify a executable path!");
 		return;
 	}
+	firstWarningLatexMissing = true;
+
+	full_command.replace("%dpi", QString::number(realDpi()));
+	if (full_command.contains("%file"))
+		full_command.replace("%file", QString("\"%1\"").arg(QDir::toNativeSeparators(tempFileBase)));
 	else
-	{
-		firstWarningLatexMissing = true;
-	}
-
-	full_command.replace("%dpi", QString::number(realDpi()));
-	if (full_command.contains("%file")) {
-		full_command.replace("%file", QString("\"%1\"").arg(QDir::toNativeSeparators(tempFileBase)));
-	} else {
 		full_command = full_command + QString(" \"%1\"").arg(QDir::toNativeSeparators(tempFileBase));
-	}
+
 	full_command.replace("%dir", QString("\"%1\"").arg(QDir::toNativeSeparators(QDir::tempPath())));
 	latex->setWorkingDirectory(QDir::tempPath());
 
@@ -390,7 +384,7 @@
 	tempfile->write(tmp.toUtf8());
 }
 
-bool PageItem_LatexFrame::setFormula(QString formula, bool undoable)
+bool PageItem_LatexFrame::setFormula(const QString& formula, bool undoable)
 {
 	if (formula == formulaText) {
 		//Nothing changed
@@ -426,12 +420,12 @@
 	if (firstWarning)
 	{
 		if (latex->error() == QProcess::FailedToStart) {
-			ScMessageBox::critical(0, tr("Error"), "<qt>" +
+			ScMessageBox::critical(nullptr, tr("Error"), "<qt>" +
 								  tr("The application \"%1\" failed to start! Please check the path: ").
 								  arg(config->executable())
 								  + "</qt>");
 		} else {
-			ScMessageBox::critical(0, tr("Error"), "<qt>" +
+			ScMessageBox::critical(nullptr, tr("Error"), "<qt>" +
 					tr("The application \"%1\" crashed!").arg(config->executable())
 					+ "</qt>");
 		}
@@ -455,11 +449,9 @@
 
 int PageItem_LatexFrame::realDpi() const
 {
-	if (m_dpi) {
+	if (m_dpi)
 		return m_dpi;
-	} else {
-		return PrefsManager::instance()->latexResolution();
-	}
+	return PrefsManager::instance()->latexResolution();
 }
 
 void PageItem_LatexFrame::setDpi(int newDpi)
@@ -527,19 +519,21 @@
 void PageItem_LatexFrame::restore(UndoState *state, bool isUndo)
 {
 	SimpleState *ss = dynamic_cast<SimpleState*>(state);
-	if (!ss) {
+	if (!ss)
+	{
 		PageItem_ImageFrame::restore(state, isUndo);
 		return;
 	}
-	if (ss->contains("CHANGE_FORMULA")) {
+	if (ss->contains("CHANGE_FORMULA"))
+	{
 		if (isUndo)
 			setFormula(ss->get("OLD_FORMULA"), false);
 		else
 			setFormula(ss->get("NEW_FORMULA"), false);
 		rerunApplication(true);
-	} else {
+	}
+	else
 		PageItem_ImageFrame::restore(state, isUndo);
-	}
 }
 
 

Modified: trunk/Scribus/scribus/pageitem_latexframe.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pageitem_latexframe.h
==============================================================================
--- trunk/Scribus/scribus/pageitem_latexframe.h	(original)
+++ trunk/Scribus/scribus/pageitem_latexframe.h	Sun Aug  5 07:21:32 2018
@@ -69,7 +69,7 @@
 			Emits formulaAutoUpdate() when undoable is false.
 			@return Returns true if the frame has to be updated, false if nothing changed.
 		*/
-		bool setFormula(QString formula, bool undoable=true);
+		bool setFormula(const QString& formula, bool undoable=true);
 		/** @brief Get current source. */
 		QString formula() const { return formulaText; }
 		

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sun Aug  5 07:21:32 2018
@@ -207,9 +207,9 @@
 
 		int LayerLev = m_Doc->layerLevelFromID(LayerID);
 		int docItemsCount = m_Doc->Items->count();
-		ScPage* Mp=0;
-		ScPage* Dp=0;
-		PageItem* docItem=0;
+		ScPage* Mp=nullptr;
+		ScPage* Dp=nullptr;
+		PageItem* docItem=nullptr;
 		int LayerLevItem;
 		QList<PageItem*> thisList;
 		if (!OnMasterPage.isEmpty())
@@ -1351,7 +1351,7 @@
 	TabControl tabs;
 	tabs.active    = false;     // RTab
 	tabs.status    = TabNONE;   // TabCode
-	tabs.tabGlyph  = 0;         // was int charIndex ~ StartRT
+	tabs.tabGlyph  = nullptr;         // was int charIndex ~ StartRT
 	tabs.xPos      = 0;         // RTabX
 
 	QList<ParagraphStyle::TabRecord> tTabValues;
@@ -1423,7 +1423,7 @@
 		return;
 	}
 
-	if ((itLen != 0)) // || (NextBox != 0))
+	if ((itLen != 0)) // || (NextBox != nullptr))
 	{
 		// determine layout area
 		m_availableRegion = calcAvailableRegion();
@@ -1752,8 +1752,7 @@
 					wide = 0.0; realAsce = 0.0;
 					const QList<GlyphLayout>& glyphs = glyphCluster.glyphs();
 					for (const GlyphLayout& gl : glyphs) {
-						GlyphMetrics gm;
-						gm = font.glyphBBox(gl.glyph, charStyle.fontSize() / 10.0);
+						GlyphMetrics gm = font.glyphBBox(gl.glyph, charStyle.fontSize() / 10.0);
 						realCharHeight = qMax(realCharHeight, gm.ascent + gm.descent);
 						gm = font.glyphBBox(gl.glyph, chsd / 10.0);
 						realAsce = qMax(realAsce, gm.ascent + gm.descent);
@@ -3094,13 +3093,13 @@
 	if (wholeChain)
 	{
 		PageItem *prevFrame = this->prevInChain();
-		while (prevFrame != 0)
+		while (prevFrame != nullptr)
 		{
 			prevFrame->invalid = true;
 			prevFrame = prevFrame->prevInChain();
 		}
 		PageItem *nextFrame = this->nextInChain();
-		while (nextFrame != 0)
+		while (nextFrame != nullptr)
 		{
 			nextFrame->invalid = true;
 			nextFrame = nextFrame->nextInChain();
@@ -3771,7 +3770,7 @@
 			p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
 			if ((isBookmark) || (m_isAnnotation))
 				p->setPen(PrefsManager::instance()->appPrefs.displayPrefs.frameAnnotationColor, scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-			if ((BackBox != 0) || (NextBox != 0))
+			if ((BackBox != nullptr) || (NextBox != nullptr))
 				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);
@@ -3835,7 +3834,7 @@
 		return;
 
 	PageItem *nextItem = this;
-	while (nextItem->prevInChain() != 0)
+	while (nextItem->prevInChain() != nullptr)
 		nextItem = nextItem->prevInChain();
 
 	ParagraphStyle defaultStyle = nextItem->itemText.defaultStyle();
@@ -3848,7 +3847,7 @@
 		nextItem->itemText.setDefaultStyle(defaultStyle);
 	}
 
-	while (nextItem != 0)
+	while (nextItem != nullptr)
 	{
 		nextItem->invalid = true;
 		nextItem = nextItem->nextInChain();
@@ -4002,7 +4001,7 @@
 					conv = 32;
 				if (UndoManager::undoEnabled())
 				{
-					ScItemState<ParagraphStyle> *ip = 0;
+					ScItemState<ParagraphStyle> *ip = nullptr;
 					SimpleState *ss = dynamic_cast<SimpleState*>(undoManager->getLastUndo());
 					UndoObject *undoTarget = this;
 					int cursorPos = itemText.cursorPosition();
@@ -4126,7 +4125,7 @@
 					ExpandSel(oldPos);
 				}
 				else
-					if ((textLayout.lines() > 0) && (oldPos >= textLayout.line(textLayout.lines()-1)->firstChar()) && (itemText.cursorPosition() >= lastInFrame()) && (NextBox != 0))
+					if ((textLayout.lines() > 0) && (oldPos >= textLayout.line(textLayout.lines()-1)->firstChar()) && (itemText.cursorPosition() >= lastInFrame()) && (NextBox != nullptr))
 					{
 						if (NextBox->frameDisplays(itemText.cursorPosition()))
 						{
@@ -4139,7 +4138,7 @@
 			}
 			else
 			{
-				if (NextBox != 0)
+				if (NextBox != nullptr)
 				{
 					if (NextBox->frameDisplays(lastInFrame()+1))
 					{
@@ -4177,7 +4176,7 @@
 					ExpandSel(oldPos);
 				}
 				else
-					if ((textLayout.lines() > 0) && (oldPos <= textLayout.line(0)->lastChar()) && (itemText.cursorPosition()  == firstInFrame()) && (BackBox != 0))
+					if ((textLayout.lines() > 0) && (oldPos <= textLayout.line(0)->lastChar()) && (itemText.cursorPosition()  == firstInFrame()) && (BackBox != nullptr))
 					{
 						view->Deselect(true);
 						// TODO position at the right place in previous frame
@@ -5004,7 +5003,7 @@
 	QColor color(PrefsManager::instance()->appPrefs.displayPrefs.frameNormColor);
 	if ((isBookmark) || (m_isAnnotation))
 		color = PrefsManager::instance()->appPrefs.displayPrefs.frameAnnotationColor;
-	if ((BackBox != 0) || (NextBox != 0))
+	if ((BackBox != nullptr) || (NextBox != nullptr))
 		color = PrefsManager::instance()->appPrefs.displayPrefs.frameLinkColor;
 	if (m_Locked)
 		color = PrefsManager::instance()->appPrefs.displayPrefs.frameLockColor;

Modified: trunk/Scribus/scribus/pageitemiterator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pageitemiterator.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitemiterator.cpp	(original)
+++ trunk/Scribus/scribus/pageitemiterator.cpp	Sun Aug  5 07:21:32 2018
@@ -11,7 +11,7 @@
 
 PageItemIterator::PageItemIterator(const QList<PageItem*>& itemList)
 {
-	m_current = 0;
+	m_current = nullptr;
 
 	if (itemList.count() > 0)
 	{
@@ -57,6 +57,6 @@
 	}
 
 	if (m_stateStack.isEmpty())
-		m_current = 0;
+		m_current = nullptr;
 	return m_current;
-}
+}

Modified: trunk/Scribus/scribus/palettes/cxfcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/cxfcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/cxfcolor.cpp	(original)
+++ trunk/Scribus/scribus/palettes/cxfcolor.cpp	Sun Aug  5 07:21:32 2018
@@ -17,20 +17,20 @@
 CxfColor::CxfColor(CxfDocument* cxfDoc)
 {
 	m_cxfDoc = cxfDoc;
-	m_colorSpec = 0;
+	m_colorSpec = nullptr;
 }
 
 bool CxfColor::isValid() const
 {
 	bool valid = true;
-	valid &= (m_cxfDoc != 0);
-	valid &= (m_colorSpec != 0);
+	valid &= (m_cxfDoc != nullptr);
+	valid &= (m_colorSpec != nullptr);
 	return valid;
 }
 
 void CxfColor::reset()
 {
-	m_colorSpec = 0;
+	m_colorSpec = nullptr;
 }
 
 CxfColorRGB::CxfColorRGB(CxfDocument* cxfDoc)
@@ -580,4 +580,4 @@
 	int wlStart = wavelengthStart();
 	int wlInc   = m_colorSpec->measurementSpec().wavelengthIncrement();
 	return CxfMeasurementSpec::wavelengths(wlStart, wlInc, m_values.count());
-}
+}

Modified: trunk/Scribus/scribus/palettes/paletteloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader.cpp	Sun Aug  5 07:21:32 2018
@@ -12,14 +12,14 @@
 
 PaletteLoader::PaletteLoader()
 {
-	m_colors = 0;
-	m_gradients = 0;
+	m_colors = nullptr;
+	m_gradients = nullptr;
 }
 
 void PaletteLoader::setupTargets(ColorList* colors, QHash<QString, VGradient> *gradients)
 {
-	assert (colors != 0);
+	assert (colors != nullptr);
 	
 	m_colors = colors;
 	gradients = m_gradients;
-}
+}

Modified: trunk/Scribus/scribus/palettes/paletteloader_adobe_acb.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader_adobe_acb.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader_adobe_acb.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader_adobe_acb.cpp	Sun Aug  5 07:21:32 2018
@@ -42,9 +42,7 @@
 	ts >> vers;
 	file.close();
 	
-	if ((signature == 0x38424342) && (vers == 1))
-		return true;
-	return false;
+	return (signature == 0x38424342) && (vers == 1);
 }
 
 bool PaletteLoader_Adobe_acb::importFile(const QString& fileName, bool /*merge*/)

Modified: trunk/Scribus/scribus/palettes/paletteloader_adobe_aco.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader_adobe_aco.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader_adobe_aco.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader_adobe_aco.cpp	Sun Aug  5 07:21:32 2018
@@ -41,9 +41,7 @@
 	ts >> vers;
 	file.close();
 	
-	if (vers == 1)
-		return true;
-	return false;
+	return vers == 1;
 }
 
 bool PaletteLoader_Adobe_aco::importFile(const QString& fileName, bool /*merge*/)

Modified: trunk/Scribus/scribus/palettes/paletteloader_adobe_ase.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader_adobe_ase.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader_adobe_ase.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader_adobe_ase.cpp	Sun Aug  5 07:21:32 2018
@@ -44,9 +44,7 @@
 	ts >> vers1 >> vers2;
 	file.close();
 	
-	if ((signature == 0x41534546) && (vers1 == 1) && (vers2 == 0))
-		return true;
-	return false;
+	return (signature == 0x41534546) && (vers1 == 1) && (vers2 == 0);
 }
 
 bool PaletteLoader_Adobe_ase::importFile(const QString& fileName, bool /*merge*/)

Modified: trunk/Scribus/scribus/palettes/paletteloader_cxf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader_cxf.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader_cxf.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader_cxf.cpp	Sun Aug  5 07:21:32 2018
@@ -22,7 +22,7 @@
 #include "ui/cxfimportdialog.h"
 
 PaletteLoader_CxF::PaletteLoader_CxF()
-                 : PaletteLoader(), m_spectrumConvertor(ScE308Table5_D50_2deg())
+				 : m_spectrumConvertor(ScE308Table5_D50_2deg())
 {
 	
 }
@@ -106,7 +106,7 @@
 			importFunctions.append(&PaletteLoader_CxF::importObjectAsLabColor);
 	}
 
-	ColorImportFunction singleImportFunc = 0;
+	ColorImportFunction singleImportFunc = nullptr;
 	if (importFunctions.count() == 1)
 		singleImportFunc = importFunctions.at(0);
 
@@ -153,9 +153,7 @@
 
 bool PaletteLoader_CxF::canImportObjectAsCmyk(const CxfObject* object) const
 {
-	if (object->hasColor(cxfColorCMYK))
-		return true;
-	return false;
+	return object->hasColor(cxfColorCMYK);
 }
 
 bool PaletteLoader_CxF::canImportObjectAsLab(const CxfObject* object) const
@@ -319,4 +317,4 @@
 	}
 
 	return false;
-}
+}

Modified: trunk/Scribus/scribus/palettes/paletteloader_swatchbook.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/palettes/paletteloader_swatchbook.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/paletteloader_swatchbook.cpp	(original)
+++ trunk/Scribus/scribus/palettes/paletteloader_swatchbook.cpp	Sun Aug  5 07:21:32 2018
@@ -22,7 +22,6 @@
 #include "util_formats.h"
 
 PaletteLoader_Swatchbook::PaletteLoader_Swatchbook()
-                 : PaletteLoader()
 {
 
 }
@@ -31,10 +30,7 @@
 {
 	QFileInfo fi = QFileInfo(fileName);
 	QString ext = fi.suffix().toLower();
-	if (ext != "sbz")
-		return false;
-	
-	return true;
+	return ext == "sbz";
 }
 
 bool PaletteLoader_Swatchbook::importFile(const QString& fileName, bool /*merge*/)

Modified: trunk/Scribus/scribus/pdf_analyzer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pdf_analyzer.cpp
==============================================================================
--- trunk/Scribus/scribus/pdf_analyzer.cpp	(original)
+++ trunk/Scribus/scribus/pdf_analyzer.cpp	Sun Aug  5 07:21:32 2018
@@ -74,7 +74,7 @@
 		nameMapInited = true;
 	}
 
-	m_doc = 0;
+	m_doc = nullptr;
 
 	PdfError::EnableDebug( false );
 	try {

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Sun Aug  5 07:21:32 2018
@@ -124,7 +124,7 @@
 	QByteArray m_prevFontName;
 	int        m_prevFontSize;
 
-	QByteArray transformToStr(QTransform tr)
+	QByteArray transformToStr(const QTransform& tr)
 	{
 		return FToStr(tr.m11()) + " " + FToStr(-tr.m12()) + " " + FToStr(-tr.m21()) + " " + FToStr(tr.m22()) + " " + FToStr(tr.dx()) + " " + FToStr(-tr.dy());
 	}
@@ -509,10 +509,10 @@
 PDFLibCore::PDFLibCore(ScribusDoc & docu)
 	: QObject(&docu),
 	doc(docu),
-	ActPageP(0),
+	ActPageP(nullptr),
 	Options(doc.pdfOptions()),
-	Bvie(0),
-	ucs2Codec(0),
+	Bvie(nullptr),
+	ucs2Codec(nullptr),
 //	ObjCounter(7),
 	ResNam("RE"),
 	ResCount(0),
@@ -528,7 +528,7 @@
 	colorsToUse(),
 	spotNam("Spot"),
 	spotCount(0),
-	progressDialog(0),
+	progressDialog(nullptr),
 	abortExport(false),
 	usingGUI(ScCore->usingGUI()),
 	bleedDisplacementX(0),
@@ -688,12 +688,12 @@
 	return (ret && !error);
 }
 
-const QString& PDFLibCore::errorMessage(void) const
+const QString& PDFLibCore::errorMessage() const
 {
 	return ErrorMessage;
 }
 
-bool PDFLibCore::exportAborted(void) const
+bool PDFLibCore::exportAborted() const
 {
 	return abortExport;
 }
@@ -1749,7 +1749,7 @@
 	return embeddedFontObject;
 }
 
-QByteArray PDFLibCore::PDF_GenerateSubsetTag(const QByteArray& fontName, QList<uint> usedGlyphs)
+QByteArray PDFLibCore::PDF_GenerateSubsetTag(const QByteArray& fontName, const QList<uint>& usedGlyphs)
 {
 	uint hash, mod;
 	QVector<uint> glyphVec = usedGlyphs.toVector();
@@ -1816,7 +1816,7 @@
 	return fontDescriptor;
 }
 
-PdfFont PDFLibCore::PDF_EncodeCidFont(const QByteArray& fontName, ScFace& face, const QByteArray& baseFont, PdfId fontDes, const ScFace::FaceEncoding& gl, const QMap<uint,uint> glyphmap  )
+PdfFont PDFLibCore::PDF_EncodeCidFont(const QByteArray& fontName, ScFace& face, const QByteArray& baseFont, PdfId fontDes, const ScFace::FaceEncoding& gl, const QMap<uint,uint>& glyphmap  )
 {
 	PdfFont result;
 	result.name = Pdf::toName(fontName);
@@ -2528,7 +2528,7 @@
 		writer.endObj(iccColorspace);
 		ResCount++;
 	}
-	if (((Options.isGrayscale == false) && (Options.UseRGB == false)) && (Options.UseSpotColors))
+	if (((!Options.isGrayscale) && (!Options.UseRGB)) && (Options.UseSpotColors))
 	{
 		doc.getUsedColors(colorsToUse);
 		ColorList::Iterator itf;
@@ -2820,7 +2820,7 @@
 							PutPage("-1 0 0 1 "+FToStr(ite->width())+" 0 cm\n");
 						if (ite->imageFlippedV())
 							PutPage("1 0 0 -1 0 "+FToStr(-ite->height())+" cm\n");
-						if (ite->imageClip.size() != 0)
+						if (!ite->imageClip.empty())
 							PutPage(SetImagePathAndClip(ite));
 						if ((ite->imageIsAvailable) && (!ite->Pfile.isEmpty()))
 						{
@@ -3756,7 +3756,7 @@
 }
 
 
-void PDFLibCore::writeXObject(uint objNr, QByteArray dictionary, QByteArray stream)
+void PDFLibCore::writeXObject(uint objNr, const QByteArray& dictionary, const QByteArray& stream)
 {
 	writer.startObj(objNr);
 	PutDoc("<<");
@@ -3768,7 +3768,7 @@
 }
 
 
-PdfId PDFLibCore::writeObject(QByteArray type, QByteArray dictionary)
+PdfId PDFLibCore::writeObject(const QByteArray& type, const QByteArray& dictionary)
 {
 	PdfId result = writer.newObject();
 	writer.startObj(result);
@@ -4529,7 +4529,7 @@
 				tmp += "-1 0 0 1 "+FToStr(ite->width())+" 0 cm\n";
 			if (ite->imageFlippedV())
 				tmp += "1 0 0 -1 0 "+FToStr(-ite->height())+" cm\n";
-			if (ite->imageClip.size() != 0)
+			if (!ite->imageClip.empty())
 				tmp += SetImagePathAndClip(ite);
 			if ((ite->imageIsAvailable) && (!ite->Pfile.isEmpty()))
 			{
@@ -5684,7 +5684,7 @@
 QByteArray PDFLibCore::putColorUncached(const QString& color, int shade, bool fill)
 {
 	ScColor tmpC(doc.PageColors[color]);
-	if (((tmpC.isSpotColor()) || (tmpC.isRegistrationColor())) && ((Options.isGrayscale == false) && (Options.UseRGB == false))  && (Options.UseSpotColors))
+	if (((tmpC.isSpotColor()) || (tmpC.isRegistrationColor())) && ((!Options.isGrayscale) && (!Options.UseRGB))  && (Options.UseSpotColors))
 	{
 		QByteArray tmpSpot("");
 		if ((color != CommonStrings::None) && (spotMap.contains(color)))
@@ -6719,7 +6719,7 @@
 	return m;
 }
 
-void PDFLibCore::encodeColor(QDataStream &vs, QString colName, int colShade, QStringList &spotColorSet, bool spotMode)
+void PDFLibCore::encodeColor(QDataStream &vs, const QString& colName, int colShade, QStringList &spotColorSet, bool spotMode)
 {
 	if (spotMode)
 	{
@@ -8176,11 +8176,11 @@
 		GType = currItem->GrType;
 		if (GType == 9)
 			return PDF_TensorGradientFill(output, currItem);
-		else if (GType == 10)
+		if (GType == 10)
 			return PDF_DiamondGradientFill(output, currItem);
-		else if ((GType == 11) || (GType == 13))
+		if ((GType == 11) || (GType == 13))
 			return PDF_MeshGradientFill(output, currItem);
-		else if (GType == 12)
+		if (GType == 12)
 			return PDF_PatchMeshGradientFill(output, currItem);
 		StartX = currItem->GrStartX;
 		StartY = currItem->GrStartY;
@@ -10126,7 +10126,7 @@
 	{
 		case PoDoFo::ePdfDataType_Reference:
 		{
-			const PoDoFo::PdfReference reference(obj->GetReference());
+			const PoDoFo::PdfReference& reference(obj->GetReference());
 			PdfId objNr;
 			if (!importedObjects.contains(reference))
 			{
@@ -10642,12 +10642,7 @@
 			if ((Options.UseRGB) || (Options.isGrayscale))
 				imgE = false;
 			else
-			{
-				if ((Options.UseProfiles2) && (img.imgInfo.colorspace != ColorSpaceCMYK))
-					imgE = false;
-				else
-					imgE = true;
-			}
+				imgE = !((Options.UseProfiles2) && (img.imgInfo.colorspace != ColorSpaceCMYK));
 			origWidth = img.width();
 			origHeight = img.height();
 			img.applyEffect(c->effectsInUse, c->doc()->PageColors, imgE);
@@ -11179,8 +11174,7 @@
 	for (int ele = 0; ele < doc.Items->count(); ++ele)
 	{
 		PageItem* tel = doc.Items->at(ele);
-		if ((tel->asTextFrame()) && (tel->prevInChain() == 0) && (tel->nextInChain() != 0) &&
-				(!tel->inPdfArticle))
+		if ((tel->asTextFrame()) && (tel->prevInChain() == nullptr) && (tel->nextInChain() != nullptr) && (!tel->inPdfArticle))
 		{
 			Beads.clear();
 			PdfBead bd;
@@ -11190,7 +11184,7 @@
 			PdfId fir = currentThreadObj + 1;
 			PdfId ccb = currentThreadObj + 1;
 			bd.Parent = currentThreadObj;
-			while (tel->nextInChain() != 0)
+			while (tel->nextInChain() != nullptr)
 			{
 				if ((tel->OwnPage != -1) && PageTree.KidsMap.contains(tel->OwnPage))
 				{

Modified: trunk/Scribus/scribus/pdflib_core.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pdflib_core.h
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.h	(original)
+++ trunk/Scribus/scribus/pdflib_core.h	Sun Aug  5 07:21:32 2018
@@ -68,8 +68,8 @@
 	~PDFLibCore();
 	bool doExport(const QString& fn, const QString& nam, int Components, const std::vector<int> & pageNs, const QMap<int, QImage> & thumbs);
 
-	const QString& errorMessage(void) const;
-	bool  exportAborted(void) const;
+	const QString& errorMessage() const;
+	bool  exportAborted() const;
 
 private:
 	struct ShIm
@@ -101,12 +101,12 @@
 	PdfFont PDF_WriteType3Font(const QByteArray& name, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs);
 	PdfFont PDF_WriteGlyphsAsXForms(const QByteArray& fontName, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs);
 	
-	QByteArray PDF_GenerateSubsetTag(const QByteArray& fontName, QList<uint> usedGlyphs);
+	QByteArray PDF_GenerateSubsetTag(const QByteArray& fontName, const QList<uint>& usedGlyphs);
 	PdfId PDF_WriteFontDescriptor(const QByteArray& fontName, ScFace& face, ScFace::FontFormat fformat, PdfId embeddedFontObject);
 	PdfFont PDF_WriteTtfSubsetFont(const QByteArray& fontName, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs);
 	PdfFont PDF_WriteCffSubsetFont(const QByteArray& fontName, ScFace& face, const QMap<uint,FPointArray>& RealGlyphs);
 	PdfFont PDF_EncodeSimpleFont(const QByteArray& fontname, ScFace& face,  const QByteArray& baseFont, const QByteArray& subtype, bool isEmbedded, PdfId fontDes, const ScFace::FaceEncoding& gl);
-	PdfFont PDF_EncodeCidFont(const QByteArray& fontname, ScFace& face, const QByteArray& baseFont, PdfId fontDes, const ScFace::FaceEncoding& gl, const QMap<uint,uint> glyphmap);
+	PdfFont PDF_EncodeCidFont(const QByteArray& fontname, ScFace& face, const QByteArray& baseFont, PdfId fontDes, const ScFace::FaceEncoding& gl, const QMap<uint,uint>& glyphmap);
 	PdfFont PDF_EncodeFormFont(const QByteArray& fontname, ScFace& face,  const QByteArray& baseFont, const QByteArray& subtype, PdfId fontDes);
 	PdfId PDF_EmbedFontObject(const QString& fontName, ScFace &face);
 	PdfId PDF_EmbedFontObject(const QByteArray& ttf, const QByteArray& subtype);
@@ -194,8 +194,8 @@
 	uint       WritePDFStream(const QByteArray& cc, PdfId objId);
 	uint       WritePDFString(const QString& cc);
 	uint       WritePDFString(const QString& cc, PdfId objId);
-	void       writeXObject(uint objNr, QByteArray dictionary, QByteArray stream);
-	uint       writeObject(QByteArray type, QByteArray dictionary);
+	void       writeXObject(uint objNr, const QByteArray& dictionary, const QByteArray& stream);
+	uint       writeObject(const QByteArray& type, const QByteArray& dictionary);
 	uint       writeGState(QByteArray dictionary) { return writeObject("/ExtGState", dictionary); }
 	uint       writeActions(const Annotation&, uint annotationObj);
 //	QString    PDFEncode(const QString & in);
@@ -231,7 +231,7 @@
 
 	quint32 encode32dVal(double val);
 	quint16 encode16dVal(double val);
-	void    encodeColor(QDataStream &vs, QString colName, int colShade, QStringList &spotColorSet, bool spotMode);
+	void    encodeColor(QDataStream &vs, const QString& colName, int colShade, QStringList &spotColorSet, bool spotMode);
 
 	QByteArray drawArrow(PageItem *ite, QTransform &arrowTrans, int arrowIndex);
 	QByteArray createBorderAppearance(PageItem *ite);

Modified: trunk/Scribus/scribus/pdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptions.cpp	(original)
+++ trunk/Scribus/scribus/pdfoptions.cpp	Sun Aug  5 07:21:32 2018
@@ -9,7 +9,7 @@
 
 PDFOptions::VerifyResults PDFOptions::verify()
 {
-	return verify(static_cast<QString*>(NULL));
+	return verify(static_cast<QString*>(nullptr));
 }
 
 PDFOptions::VerifyResults PDFOptions::verify(QString* /*problemDescription*/)

Modified: trunk/Scribus/scribus/pluginmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/pluginmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/pluginmanager.cpp	(original)
+++ trunk/Scribus/scribus/pluginmanager.cpp	Sun Aug  5 07:21:32 2018
@@ -40,7 +40,7 @@
 extern ScribusQApp *ScQApp;
 
 PluginManager::PluginManager() :
-	QObject(0),
+	QObject(nullptr),
 	prefs(PrefsManager::instance()->prefsFile->getPluginContext("pluginmanager"))
 {
 }
@@ -152,8 +152,8 @@
 		// Couldn't determine plugname from filename. We've already complained, so
 		// move on to the next one.
 		return 0;
-	pda.plugin = 0;
-	pda.pluginDLL = 0;
+	pda.plugin = nullptr;
+	pda.pluginDLL = nullptr;
 	pda.enabled = false;
 	pda.enableOnStartup = prefs->getBool(pda.pluginName, false);
 	ScCore->setSplashStatus( tr("Plugin: loading %1", "plugin manager").arg(pda.pluginName));
@@ -278,7 +278,7 @@
 bool PluginManager::setupPluginActions(ScribusMainWindow *mw)
 {
 	Q_CHECK_PTR(mw);
-	ScActionPlugin* plugin = 0;
+	ScActionPlugin* plugin = nullptr;
 
 	//mw->scrMenuMgr->addMenuItemString("SEPARATOR", "Extras");
 	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
@@ -369,7 +369,7 @@
 bool PluginManager::setupPluginActions(StoryEditor *sew)
 {
 	Q_CHECK_PTR(sew);
-	ScActionPlugin* plugin = 0;
+	ScActionPlugin* plugin = nullptr;
 
 	//sew->seMenuMgr->addMenuSeparator("Extras");
 	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
@@ -431,7 +431,7 @@
 void PluginManager::enableOnlyStartupPluginActions(ScribusMainWindow* mw)
 {
 	Q_CHECK_PTR(mw);
-	ScActionPlugin* plugin = 0;
+	ScActionPlugin* plugin = nullptr;
 	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
 	{
 		if (it.value().plugin->inherits("ScActionPlugin"))
@@ -452,8 +452,8 @@
 	if (!doc)
 		return;
 
-	ScActionPlugin* ixplug = 0;
-	ScrAction* pluginAction = 0;
+	ScActionPlugin* ixplug = nullptr;
+	ScrAction* pluginAction = nullptr;
 	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
 	{
 		if (it.value().plugin->inherits("ScActionPlugin"))
@@ -464,7 +464,7 @@
 			{
 				ScActionPlugin::ActionInfo ai(ixplug->actionInfo());
 				pluginAction = mw->scrActions[ai.name];
-				if (pluginAction != 0)
+				if (pluginAction != nullptr)
 				{
 					if (doc->m_Selection->count() != 0)
 						pluginAction->setEnabled(ixplug->handleSelection(doc, doc->m_Selection->itemAt(0)->itemType()));
@@ -487,8 +487,7 @@
 			// and the plugin must be enabled unless we were told otherwise
 			if (pluginMap[name].enabled)
 				return true;
-			else
-				return includeDisabled;
+			return includeDisabled;
 		}
 	}
 	return false;
@@ -501,10 +500,10 @@
 	getPluginAPIVersionPtr getPluginAPIVersion;
 	getPluginPtr getPlugin;
 
-	Q_ASSERT(pda.plugin == 0);
-	Q_ASSERT(pda.pluginDLL == 0);
+	Q_ASSERT(pda.plugin == nullptr);
+	Q_ASSERT(pda.pluginDLL == nullptr);
 	Q_ASSERT(!pda.enabled);
-	pda.plugin = 0;
+	pda.plugin = nullptr;
 
 	pda.pluginDLL = loadDLL(pda.pluginFile);
 	if (!pda.pluginDLL)
@@ -538,7 +537,7 @@
 		}
 	}
 	unloadDLL(pda.pluginDLL);
-	pda.pluginDLL = 0;
+	pda.pluginDLL = nullptr;
 	Q_ASSERT(!pda.plugin);
 	return false;
 }
@@ -562,13 +561,13 @@
 			(freePluginPtr) resolveSym(pluginData.pluginDLL, QString(pluginData.pluginName + "_freePlugin").toLocal8Bit().data());
 		if ( freePlugin )
 			(*freePlugin)( pluginData.plugin );
-		pluginData.plugin = 0;
+		pluginData.plugin = nullptr;
 	}
 	Q_ASSERT(!pluginData.enabled);
 	if (pluginData.pluginDLL)
 	{
 		unloadDLL(pluginData.pluginDLL);
-		pluginData.pluginDLL = 0;
+		pluginData.pluginDLL = nullptr;
 	}
 }
 
@@ -640,9 +639,9 @@
 
 void PluginManager::languageChange()
 {
-	ScPlugin* plugin = 0;
-	ScActionPlugin* ixplug = 0;
-	ScrAction* pluginAction = 0;
+	ScPlugin* plugin = nullptr;
+	ScActionPlugin* ixplug = nullptr;
+	ScrAction* pluginAction = nullptr;
 	for (PluginMap::Iterator it = pluginMap.begin(); it != pluginMap.end(); ++it)
 	{
 		plugin = it.value().plugin;
@@ -654,7 +653,7 @@
 			{
 				ScActionPlugin::ActionInfo ai(ixplug->actionInfo());
 				pluginAction = ScCore->primaryMainWindow()->scrActions[ai.name];
-				if (pluginAction != 0)
+				if (pluginAction != nullptr)
 					pluginAction->setText( ai.text );
 				if ((!ai.menu.isEmpty()) && (!ai.subMenuName.isEmpty()))
 					ScCore->primaryMainWindow()->scrMenuMgr->setText(ai.menu, ai.subMenuName);
@@ -667,7 +666,7 @@
 {
 	if (DLLexists(pluginName, includeDisabled))
 		return pluginMap[pluginName].plugin;
-	return 0;
+	return nullptr;
 }
 
 PluginManager & PluginManager::instance()

Modified: trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp	(original)
+++ trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp	Sun Aug  5 07:21:32 2018
@@ -29,7 +29,7 @@
 	delete plug;
 }
 
-ColorWheelPlugin::ColorWheelPlugin() : ScActionPlugin()
+ColorWheelPlugin::ColorWheelPlugin()
 {
 	// Set action info in languageChange, so we only have to do
 	// it in one place.
@@ -83,9 +83,9 @@
 {
 	Q_ASSERT(target.isNull());
 	ScribusDoc* currDoc=doc;
-	if (currDoc==0)
+	if (currDoc==nullptr)
 		currDoc=ScCore->primaryMainWindow()->doc;
-	if (currDoc==0)
+	if (currDoc==nullptr)
 		return false;
 	CWDialog *dlg = new CWDialog(currDoc->scMW(), currDoc, "dlg", true);
 	if (dlg)
@@ -94,6 +94,5 @@
 		delete dlg;
 		return true;
 	}
-	else
-		return false;
+	return false;
 }

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.cpp	Sun Aug  5 07:21:32 2018
@@ -23,8 +23,8 @@
 #include "usertaskstructs.h"
 #include "util.h"
 
-ExportForm::ExportForm(QWidget* parent, ScribusDoc* doc, int size, int quality, QString type)
-	: QDialog(parent, 0), m_doc(doc), m_PageCount(doc->DocPages.count())
+ExportForm::ExportForm(QWidget* parent, ScribusDoc* doc, int size, int quality, const QString& type)
+	: QDialog(parent, nullptr), m_doc(doc), m_PageCount(doc->DocPages.count())
 {
 	setupUi(this);
 	setModal(true);

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/dialog.h	Sun Aug  5 07:21:32 2018
@@ -17,7 +17,7 @@
 	Q_OBJECT
 
 public:
-	ExportForm( QWidget* parent, ScribusDoc* doc, int size, int quality, QString type);
+	ExportForm( QWidget* parent, ScribusDoc* doc, int size, int quality, const QString& type);
 	~ExportForm();
 
 public slots:

Modified: trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp	Sun Aug  5 07:21:32 2018
@@ -99,7 +99,7 @@
 	Q_ASSERT(target.isEmpty());
 	Q_ASSERT(!doc->masterPageMode());
 	QSharedPointer<ExportBitmap> ex( new ExportBitmap() );
-	QSharedPointer<ExportForm>  dia( new ExportForm(0, doc, ex->pageDPI, ex->quality, ex->bitmapType) );
+	QSharedPointer<ExportForm>  dia( new ExportForm(nullptr, doc, ex->pageDPI, ex->quality, ex->bitmapType) );
 
 	// interval widgets handling
 	QString tmp;
@@ -210,7 +210,7 @@
 		over = ScMessageBox::question(doc->scMW(), tr("File exists. Overwrite?"),
 				fn +"\n"+ tr("exists already. Overwrite?"),
 				// hack for multiple overwriting (petr) 
-				(single == true) ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll,
+				(single) ? QMessageBox::Yes | QMessageBox::No : QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll,
 				QMessageBox::NoButton,	// GUI default
 				QMessageBox::YesToAll);	// batch default
 		QApplication::changeOverrideCursor(QCursor(Qt::WaitCursor));

Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp	Sun Aug  5 07:21:32 2018
@@ -128,7 +128,7 @@
 {
 	Q_ASSERT(filename.isEmpty());
 	QString fileName;
-	if (doc!=0)
+	if (doc!=nullptr)
 	{
 		PrefsContext* prefs = PrefsManager::instance()->prefsFile->getPluginContext("svgex");
 		QString wdir = prefs->get("wdir", ".");
@@ -196,7 +196,7 @@
 	glyphNames.clear();
 }
 
-bool SVGExPlug::doExport( QString fName, SVGOptions &Opts )
+bool SVGExPlug::doExport( const QString& fName, SVGOptions &Opts )
 {
 	Options = Opts;
 	QFileInfo fiBase(fName);
@@ -718,7 +718,7 @@
 	return "filter:url(#"+ID+");";
 }
 
-QDomElement SVGExPlug::processHatchFill(PageItem *Item, QString transl)
+QDomElement SVGExPlug::processHatchFill(PageItem *Item, const QString& transl)
 {
 	QDomElement ob;
 	ob = docu.createElement("g");
@@ -825,7 +825,7 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processSymbolStroke(PageItem *Item, QString trans)
+QDomElement SVGExPlug::processSymbolStroke(PageItem *Item, const QString& trans)
 {
 	QDomElement ob;
 	ob = docu.createElement("g");
@@ -876,7 +876,7 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processSymbolItem(PageItem *Item, QString trans)
+QDomElement SVGExPlug::processSymbolItem(PageItem *Item, const QString& trans)
 {
 	QDomElement ob;
 	ScPattern pat = m_Doc->docPatterns[Item->pattern()];
@@ -891,14 +891,11 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processPolyItem(PageItem *Item, QString trans, QString fill, QString stroke)
+QDomElement SVGExPlug::processPolyItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke)
 {
 	bool closedPath;
 	QDomElement ob;
-	if ((Item->itemType() == PageItem::Polygon) || (Item->itemType() == PageItem::RegularPolygon) || (Item->itemType() == PageItem::Arc))
-		closedPath = true;
-	else
-		closedPath = false;
+	closedPath = (Item->itemType() == PageItem::Polygon) || (Item->itemType() == PageItem::RegularPolygon) || (Item->itemType() == PageItem::Arc);
 	if (Item->NamedLStyle.isEmpty())
 	{
 		if ((!Item->strokePattern().isEmpty()) && (Item->patternStrokePath))
@@ -980,7 +977,7 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processLineItem(PageItem *Item, QString trans, QString stroke)
+QDomElement SVGExPlug::processLineItem(PageItem *Item, const QString& trans, const QString& stroke)
 {
 	QDomElement ob;
 	if (Item->NamedLStyle.isEmpty())
@@ -995,13 +992,13 @@
 		ob = docu.createElement("g");
 		ob.setAttribute("transform", trans);
 		multiLine ml = m_Doc->MLineStyles[Item->NamedLStyle];
-		for (int it = ml.size()-1; it > -1; it--)
-		{
-			if ((ml[it].Color != CommonStrings::None) && (ml[it].Width != 0))
+		for (int i = ml.size()-1; i > -1; i--)
+		{
+			if ((ml[i].Color != CommonStrings::None) && (ml[i].Width != 0))
 			{
 				QDomElement ob2 = docu.createElement("path");
 				ob2.setAttribute("d", "M 0 0 L "+FToStr(Item->width())+" 0");
-				ob2.setAttribute("style", GetMultiStroke(&ml[it], Item));
+				ob2.setAttribute("style", GetMultiStroke(&ml[i], Item));
 				ob.appendChild(ob2);
 			}
 		}
@@ -1009,7 +1006,7 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processImageItem(PageItem *Item, QString trans, QString fill, QString stroke)
+QDomElement SVGExPlug::processImageItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke)
 {
 	QDomElement ob;
 	ob = docu.createElement("g");
@@ -1035,7 +1032,7 @@
 	if ((Item->imageIsAvailable) && (!Item->Pfile.isEmpty()))
 	{
 		QDomElement cl, ob2;
-		if (Item->imageClip.size() != 0)
+		if (!Item->imageClip.empty())
 			ob2 = createClipPathElement(&Item->imageClip, &cl);
 		else
 			ob2 = createClipPathElement(&Item->PoLine, &cl);
@@ -1151,7 +1148,7 @@
 	QString m_trans;
 
 public:
-	SvgPainter(QString trans, SVGExPlug *svg, QDomElement &elem)
+	SvgPainter(const QString& trans, SVGExPlug *svg, QDomElement &elem)
 		: m_elem(elem)
 		, m_svg(svg)
 		, m_trans(trans)
@@ -1249,7 +1246,7 @@
 	}
 };
 
-QDomElement SVGExPlug::processTextItem(PageItem *Item, QString trans, QString fill, QString stroke)
+QDomElement SVGExPlug::processTextItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke)
 {
 	QDomElement ob;
 	ob = docu.createElement("g");
@@ -1358,7 +1355,7 @@
 	return ob;
 }
 
-QDomElement SVGExPlug::processInlineItem(PageItem* embItem, QString trans, double scaleH, double scaleV)
+QDomElement SVGExPlug::processInlineItem(PageItem* embItem, const QString& trans, double scaleH, double scaleV)
 {
 	QList<PageItem*> emG;
 	if (embItem->isGroup())
@@ -1469,7 +1466,7 @@
 	return layerGroup;
 }
 
-QString SVGExPlug::handleGlyph(uint gid, const ScFace font)
+QString SVGExPlug::handleGlyph(uint gid, const ScFace& font)
 {
 	QString glName = QString("Gl%1%2").arg(font.psName().simplified().replace(QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )).arg(gid);
 	if (glyphNames.contains(glName))
@@ -1483,7 +1480,7 @@
 	return glName;
 }
 
-QDomElement SVGExPlug::processArrows(PageItem *Item, QDomElement line, QString trans)
+QDomElement SVGExPlug::processArrows(PageItem *Item, const QDomElement& line, const QString& trans)
 {
 	QDomElement ob, gr;
 	gr = docu.createElement("g");

Modified: trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h	(original)
+++ trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h	Sun Aug  5 07:21:32 2018
@@ -70,7 +70,7 @@
 	SVGExPlug( ScribusDoc* doc );
 	~SVGExPlug();
 
-	bool doExport( QString fName, SVGOptions &Opts );
+	bool doExport( const QString& fName, SVGOptions &Opts );
 	SVGOptions Options;
 
 private:
@@ -84,16 +84,16 @@
 	void ProcessItemOnPage(double xOffset, double yOffset, PageItem *Item, QDomElement *parentElem);
 	void paintBorder(const TableBorder& border, const QPointF& start, const QPointF& end, const QPointF& startOffsetFactors, const QPointF& endOffsetFactors, QDomElement &ob);
 	QString processDropShadow(PageItem *Item);
-	QDomElement processHatchFill(PageItem *Item, QString transl = "");
-	QDomElement processSymbolStroke(PageItem *Item, QString trans);
-	QDomElement processSymbolItem(PageItem *Item, QString trans);
-	QDomElement processPolyItem(PageItem *Item, QString trans, QString fill, QString stroke);
-	QDomElement processLineItem(PageItem *Item, QString trans, QString stroke);
-	QDomElement processImageItem(PageItem *Item, QString trans, QString fill, QString stroke);
-	QDomElement processTextItem(PageItem *Item, QString trans, QString fill, QString stroke);
-	QDomElement processInlineItem(PageItem* embItem, QString trans, double scaleH, double scaleV);
-	QString handleGlyph(uint gid, const ScFace font);
-	QDomElement processArrows(PageItem *Item, QDomElement line, QString trans);
+	QDomElement processHatchFill(PageItem *Item, const QString& transl = "");
+	QDomElement processSymbolStroke(PageItem *Item, const QString& trans);
+	QDomElement processSymbolItem(PageItem *Item, const QString& trans);
+	QDomElement processPolyItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke);
+	QDomElement processLineItem(PageItem *Item, const QString& trans, const QString& stroke);
+	QDomElement processImageItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke);
+	QDomElement processTextItem(PageItem *Item, const QString& trans, const QString& fill, const QString& stroke);
+	QDomElement processInlineItem(PageItem* embItem, const QString& trans, double scaleH, double scaleV);
+	QString handleGlyph(uint gid, const ScFace& font);
+	QDomElement processArrows(PageItem *Item, const QDomElement& line, const QString& trans);
 	QString handleMask(PageItem *Item, double xOffset, double yOffset);
 	QString getFillStyle(PageItem *Item);
 	QString getStrokeStyle(PageItem *Item);

Modified: trunk/Scribus/scribus/undoobject.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/undoobject.cpp
==============================================================================
--- trunk/Scribus/scribus/undoobject.cpp	(original)
+++ trunk/Scribus/scribus/undoobject.cpp	Sun Aug  5 07:21:32 2018
@@ -71,7 +71,7 @@
 	return m_uname;	
 }
 
-void UndoObject::setUName(QString newUName)
+void UndoObject::setUName(const QString& newUName)
 {
 	m_uname = newUName;
 }

Modified: trunk/Scribus/scribus/undoobject.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/undoobject.h
==============================================================================
--- trunk/Scribus/scribus/undoobject.h	(original)
+++ trunk/Scribus/scribus/undoobject.h	Sun Aug  5 07:21:32 2018
@@ -84,7 +84,7 @@
 	 * @brief Set the name of the UndoObject
 	 * @param newUName New name for the UndoObject
 	 */
-	virtual void setUName(QString newUName);
+	virtual void setUName(const QString& newUName);
 
 	/**
 	 * @brief Returns the pixmap connected to this object.

Modified: trunk/Scribus/scribus/updatemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/updatemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/updatemanager.cpp	(original)
+++ trunk/Scribus/scribus/updatemanager.cpp	Sun Aug  5 07:21:32 2018
@@ -44,13 +44,8 @@
 bool UpdateManager::requestUpdate(UpdateManaged* observable, UpdateMemento* what)
 {
 	if (m_updatesDisabled == 0)
-	{
 		return true;	
-	}
-	else
-	{
-		m_pending.insert(PendingUpdate(observable, what));
-		return false;
-	}
+	m_pending.insert(PendingUpdate(observable, what));
+	return false;
 }
 

Modified: trunk/Scribus/scribus/upgradechecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/upgradechecker.cpp
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.cpp	(original)
+++ trunk/Scribus/scribus/upgradechecker.cpp	Sun Aug  5 07:21:32 2018
@@ -28,14 +28,14 @@
 #define sleep(t) Sleep(t*1000)
 #endif
 
-UpgradeChecker::UpgradeChecker() : QObject()
+UpgradeChecker::UpgradeChecker()
 {
 	init();
 
 	m_fin = false;
-	m_file = 0;
-	m_networkManager = 0;
-	m_networkReply = 0;
+	m_file = nullptr;
+	m_networkManager = nullptr;
+	m_networkReply = nullptr;
 	m_writeToConsole = true;
 }
 
@@ -77,7 +77,7 @@
 
 	m_file=new QFile(m_tempFile);
 	m_networkManager=new QNetworkAccessManager(this);
-	if (m_networkManager!=0 && m_file!=0)
+	if (m_networkManager!=nullptr && m_file!=nullptr)
 	{
 		outputText( tr("No data on your computer will be sent to an external location"));
 		qApp->processEvents();
@@ -115,7 +115,7 @@
 		m_file->remove();
 	}
 	delete m_file;
-	m_file=0;
+	m_file=nullptr;
 	outputText( tr("Finished") );
 	m_networkReply->deleteLater();
 	m_networkManager->deleteLater();
@@ -185,18 +185,18 @@
 						if (verMajor==major && verMinor==minor && verRevsion1==m_revision1 && verRevsion2==m_revision2 && m_isCVS && !verIsCVS && !m_updates.contains(verA))
 							newVersion = true;
 						else
-						//If we found a version that is not the same as what we are running
-						if (!(verMajor==major && verMinor==minor && verRevsion1==m_revision1 && verRevsion2==m_revision2))
-						{
-							if (
-								((verMajor>major) ||
-								(verMajor==major && verMinor>minor) ||
-								(verMajor==major && verMinor==minor && verRevsion1>m_revision1) ||
-								(verMajor==major && verMinor==minor && verRevsion1==m_revision1 && verRevsion2>m_revision2))
-								&& !m_updates.contains(verA)
-								)
-								newVersion = true;
-						}
+							//If we found a version that is not the same as what we are running
+							if (!(verMajor==major && verMinor==minor && verRevsion1==m_revision1 && verRevsion2==m_revision2))
+							{
+								if (
+										((verMajor>major) ||
+										 (verMajor==major && verMinor>minor) ||
+										 (verMajor==major && verMinor==minor && verRevsion1>m_revision1) ||
+										 (verMajor==major && verMinor==minor && verRevsion1==m_revision1 && verRevsion2>m_revision2))
+										&& !m_updates.contains(verA)
+										)
+									newVersion = true;
+							}
 						if (newVersion)
 						{
 							QString ver(verA);
@@ -212,10 +212,10 @@
 				}
 			}
 			else
-			if (e.tagName()=="message")
-			{
-				m_message+=e.text();
-			}
+				if (e.tagName()=="message")
+				{
+					m_message+=e.text();
+				}
 		}
 		n = n.nextSibling();
 	}
@@ -248,7 +248,7 @@
 	outputText(m_message);
 }
 
-void UpgradeChecker::outputText(QString text, bool /*noLineFeed*/)
+void UpgradeChecker::outputText(const QString& text, bool /*noLineFeed*/)
 {
 	QString outText(text);
 	outText.remove("<b>");
@@ -280,20 +280,20 @@
 {
 }
 
-void UpgradeCheckerGUI::outputText(QString text, bool noLineFeed)
+void UpgradeCheckerGUI::outputText(const QString& text, bool noLineFeed)
 {
 	QTextBrowser* w=m_outputWidget;
-	if (w)
-	{
-		QString wText(w->toPlainText());
-		wText.replace("\n","<br>");
-		wText.remove("<qt>");
-		wText.remove("</qt>");
-		if (noLineFeed)
-			w->setHtml("<qt>"+wText+text+"</qt>");
-		else
-			w->setHtml("<qt>"+wText+text+"<br>"+"</qt>");
-	}	
-}
-
-
+	if (!w)
+		return;
+
+	QString wText(w->toPlainText());
+	wText.replace("\n","<br>");
+	wText.remove("<qt>");
+	wText.remove("</qt>");
+	if (noLineFeed)
+		w->setHtml("<qt>"+wText+text+"</qt>");
+	else
+		w->setHtml("<qt>"+wText+text+"<br>"+"</qt>");
+}
+
+

Modified: trunk/Scribus/scribus/upgradechecker.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/upgradechecker.h
==============================================================================
--- trunk/Scribus/scribus/upgradechecker.h	(original)
+++ trunk/Scribus/scribus/upgradechecker.h	Sun Aug  5 07:21:32 2018
@@ -37,7 +37,7 @@
 	
 protected:
 	void init();
-	virtual void outputText(QString text, bool noLineFeed=false);
+	virtual void outputText(const QString& text, bool noLineFeed=false);
 	void reportError(const QString& s);
 	bool m_writeToConsole;
 	QString m_version;
@@ -64,7 +64,7 @@
 	~UpgradeCheckerGUI();
 	
 protected:
-	virtual void outputText(QString text, bool noLineFeed=false);
+	virtual void outputText(const QString& text, bool noLineFeed=false);
 	QTextBrowser *m_outputWidget;
 };
 

Modified: trunk/Scribus/scribus/urllauncher.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/urllauncher.cpp
==============================================================================
--- trunk/Scribus/scribus/urllauncher.cpp	(original)
+++ trunk/Scribus/scribus/urllauncher.cpp	Sun Aug  5 07:21:32 2018
@@ -18,9 +18,9 @@
 #include "scribuscore.h"
 #include "util.h"
 
-UrlLauncher* UrlLauncher::_instance = 0;
+UrlLauncher* UrlLauncher::_instance = nullptr;
 
-UrlLauncher::UrlLauncher() : QObject()
+UrlLauncher::UrlLauncher()
 {
 }
 
@@ -30,7 +30,7 @@
 
 UrlLauncher* UrlLauncher::instance()
 {
-	if (_instance == 0)
+	if (_instance == nullptr)
 		_instance = new UrlLauncher();
 
 	return _instance;
@@ -38,22 +38,21 @@
 
 void UrlLauncher::deleteInstance()
 {
-	if (_instance)
-		delete _instance;
-	_instance = 0;
+	delete _instance;
+	_instance = nullptr;
 }
 
-void UrlLauncher::launchUrlExt(QString link, QWidget *parent)
+void UrlLauncher::launchUrlExt(const QString& link, QWidget *parent)
 {
 	launchUrlExt(QUrl(link), parent);
 }
 
-void UrlLauncher::launchUrlExt(QUrl link, QWidget *parent)
+void UrlLauncher::launchUrlExt(const QUrl& link, QWidget *parent)
 {
 	if (link.scheme()=="http" || link.scheme()=="https")
 	{
 		QWidget *p=parent;
-		if (p==0)
+		if (p==nullptr)
 			p=ScCore->primaryMainWindow();
 		QString extBrowser(PrefsManager::instance()->extBrowserExecutable());
 		if (extBrowser.isEmpty())

Modified: trunk/Scribus/scribus/urllauncher.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/urllauncher.h
==============================================================================
--- trunk/Scribus/scribus/urllauncher.h	(original)
+++ trunk/Scribus/scribus/urllauncher.h	Sun Aug  5 07:21:32 2018
@@ -37,8 +37,8 @@
 		static void deleteInstance();
 		
 	public slots:
-		void launchUrlExt(QString link, QWidget *parent=0);
-		void launchUrlExt(QUrl link, QWidget *parent=0);
+		void launchUrlExt(const QString& link, QWidget *parent=0);
+		void launchUrlExt(const QUrl& link, QWidget *parent=0);
 
 	private:
 		/**

Modified: trunk/Scribus/scribus/util_file.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_file.cpp
==============================================================================
--- trunk/Scribus/scribus/util_file.cpp	(original)
+++ trunk/Scribus/scribus/util_file.cpp	Sun Aug  5 07:21:32 2018
@@ -114,8 +114,7 @@
 			success = QFile::rename(tempFileName, target);
 		}
 	}
-	if (tempFile)
-		delete tempFile;
+	delete tempFile;
 	return success;
 }
 
@@ -262,9 +261,9 @@
 				{
 					doc->m_Selection->clear();
 					doc->m_Selection->delaySignalsOn();
-					fmt->setupTargets(doc, 0, 0, 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
+					fmt->setupTargets(doc, nullptr, nullptr, nullptr, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
 					fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-					if (doc->m_Selection->count() > 0)
+					if (!doc->m_Selection->isEmpty())
 					{
 						retObj = doc->groupObjectsSelection();
 						retObj->setTextFlowMode(PageItem::TextFlowUsesBoundingBox);

Modified: trunk/Scribus/scribus/util_formats.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_formats.cpp
==============================================================================
--- trunk/Scribus/scribus/util_formats.cpp	(original)
+++ trunk/Scribus/scribus/util_formats.cpp	Sun Aug  5 07:21:32 2018
@@ -20,7 +20,7 @@
 #include <magick/symbols.h>
 #endif
 
-FormatsManager* FormatsManager::m_instance = 0;
+FormatsManager* FormatsManager::m_instance = nullptr;
 
 FormatsManager::FormatsManager()
 {
@@ -163,7 +163,7 @@
 
 FormatsManager* FormatsManager::instance()
 {
-	if (m_instance == 0)
+	if (m_instance == nullptr)
 		m_instance = new FormatsManager();
 
 	return m_instance;
@@ -171,9 +171,8 @@
 
 void FormatsManager::deleteInstance()
 {
-	if (m_instance)
-		delete m_instance;
-	m_instance = 0;
+	delete m_instance;
+	m_instance = nullptr;
 }
 
 void FormatsManager::imageFormatSupported(const QString& ext)
@@ -376,7 +375,7 @@
 	return strl.contains(ext, Qt::CaseInsensitive);
 }
 
-QString getImageType(QString filename)
+QString getImageType(const QString& filename)
 {
 	QString ret;
 	QFile f(filename);

Modified: trunk/Scribus/scribus/util_formats.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_formats.h
==============================================================================
--- trunk/Scribus/scribus/util_formats.h	(original)
+++ trunk/Scribus/scribus/util_formats.h	Sun Aug  5 07:21:32 2018
@@ -29,7 +29,7 @@
 bool SCRIBUS_API extensionIndicatesPSD(const QString &ext);
 bool SCRIBUS_API extensionIndicatesPattern(const QString &ext);
 bool SCRIBUS_API extensionIndicatesTIFF(const QString &ext);
-QString SCRIBUS_API getImageType(QString filename);
+QString SCRIBUS_API getImageType(const QString& filename);
 
 class SCRIBUS_API FormatsManager
 {

Modified: trunk/Scribus/scribus/util_printer.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_printer.cpp
==============================================================================
--- trunk/Scribus/scribus/util_printer.cpp	(original)
+++ trunk/Scribus/scribus/util_printer.cpp	Sun Aug  5 07:21:32 2018
@@ -137,9 +137,9 @@
 	bool psSupported = toFile || PrinterUtil::isPostscriptPrinter(printerName);
 	if (psSupported && (engine >= PostScript1 && engine <= PostScript3))
 		return true;
-	else if (!psSupported && (engine >= PostScript1 && engine <= PostScript3))
-		return false;
-	else if (engine == WindowsGDI)
+	if (!psSupported && (engine >= PostScript1 && engine <= PostScript3))
+		return false;
+	if (engine == WindowsGDI)
 	{
 #if defined(_WIN32)
 		return true; //WindowsGDI
@@ -151,7 +151,7 @@
 }
 
 //Parameter needed on win32..
-bool PrinterUtil::isPostscriptPrinter(QString printerName)
+bool PrinterUtil::isPostscriptPrinter(const QString& printerName)
 {
 #ifdef _WIN32
 	HDC dc;

Modified: trunk/Scribus/scribus/util_printer.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_printer.h
==============================================================================
--- trunk/Scribus/scribus/util_printer.h	(original)
+++ trunk/Scribus/scribus/util_printer.h	Sun Aug  5 07:21:32 2018
@@ -91,7 +91,7 @@
 		 * @return true is printer support postscript, false otherwise.
 		 *
 		 */
-		static bool isPostscriptPrinter( QString printerName );
+		static bool isPostscriptPrinter( const QString& printerName );
 };
 
 #endif // DRUCK_H

Modified: trunk/Scribus/scribus/util_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_text.cpp
==============================================================================
--- trunk/Scribus/scribus/util_text.cpp	(original)
+++ trunk/Scribus/scribus/util_text.cpp	Sun Aug  5 07:21:32 2018
@@ -26,7 +26,8 @@
 {
 	bool named = !parStyle.name().isEmpty();
 	//qDebug() << QString("looking up %1/ %2").arg(parStyle.name()).arg(parStyle.alignment()); 
-	if (named) {
+	if (named)
+	{
 		for (int i=0; i < doc->paragraphStyles().count(); ++i)
 		{
 			//qDebug() << QString("%1 %2").arg(i).arg(doc->paragraphStyles()[i].name());
@@ -35,26 +36,22 @@
 			}
 		}
 		assert(false);
-		return -1;
 	}
-	else {
-		return -1;
-	}
+	return -1;
 }
 
 int findParagraphStyle(ScribusDoc* doc, const QString &name)
 {
 	for (int i=0; i < doc->paragraphStyles().count(); ++i)
 	{
-		if (name == doc->paragraphStyles()[i].name()) {
+		if (name == doc->paragraphStyles()[i].name())
 			return i;
-		}
 	}
 	assert(false);
 	return -1;
 }
 
-StoryText desaxeString(ScribusDoc* doc, QString saxedString)
+StoryText desaxeString(ScribusDoc* doc, const QString& saxedString)
 {
 	assert(!saxedString.isEmpty());
 

Modified: trunk/Scribus/scribus/util_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/util_text.h
==============================================================================
--- trunk/Scribus/scribus/util_text.h	(original)
+++ trunk/Scribus/scribus/util_text.h	Sun Aug  5 07:21:32 2018
@@ -23,7 +23,7 @@
 #endif
 
 // returns StoryText from saxed string
-StoryText SCRIBUS_API desaxeString(ScribusDoc* doc, QString saxedString);
+StoryText SCRIBUS_API desaxeString(ScribusDoc* doc, const QString& saxedString);
 
 //returns string with saxed story
 QString SCRIBUS_API saxedText(StoryText* story);

Modified: trunk/Scribus/scribus/vgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/vgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradient.cpp	(original)
+++ trunk/Scribus/scribus/vgradient.cpp	Sun Aug  5 07:21:32 2018
@@ -33,7 +33,7 @@
 {
 	double r1 = item1->rampPoint;
 	double r2 = item2->rampPoint;
-	return ( r1 < r2 ? true : false );
+	return ( r1 < r2 );
 }
 
 int VGradient::compareItems(const VColorStop* item1, const VColorStop* item2 ) const

Modified: trunk/Scribus/scribus/vgradientex.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22600&path=/trunk/Scribus/scribus/vgradientex.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradientex.cpp	(original)
+++ trunk/Scribus/scribus/vgradientex.cpp	Sun Aug  5 07:21:32 2018
@@ -34,7 +34,7 @@
 {
 	double r1 = item1->rampPoint;
 	double r2 = item2->rampPoint;
-	return ( r1 < r2 ? true : false );
+	return ( r1 < r2 );
 }
 
 int VGradientEx::compareItems( const VColorStopEx* item1, const VColorStopEx* item2 ) const




More information about the scribus-commit mailing list