r22599 by craig - clazy and clang fixes, part 1

scribus-commit scribus-commit at lists.scribus.net
Sun Aug 5 06:40:18 UTC 2018


Author: craig
Date: Sun Aug  5 06:40:18 2018
New Revision: 22599

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

Modified:
    trunk/Scribus/scribus/appmodehelper.cpp
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvasgesture_resize.cpp
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/canvasmode_create.cpp
    trunk/Scribus/scribus/canvasmode_drawbezier.cpp
    trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
    trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
    trunk/Scribus/scribus/canvasmode_edit.cpp
    trunk/Scribus/scribus/canvasmode_editarc.cpp
    trunk/Scribus/scribus/canvasmode_editgradient.cpp
    trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
    trunk/Scribus/scribus/canvasmode_edittable.cpp
    trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
    trunk/Scribus/scribus/canvasmode_framelinks.cpp
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/chartablemodel.cpp
    trunk/Scribus/scribus/chartableview.cpp
    trunk/Scribus/scribus/collect4output.cpp
    trunk/Scribus/scribus/colormgmt/scciedata.cpp
    trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
    trunk/Scribus/scribus/colormgmt/sccolortransform.cpp
    trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp
    trunk/Scribus/scribus/colormgmt/sccolortransformpool.h
    trunk/Scribus/scribus/colormgmt/sce308tables.cpp
    trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
    trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
    trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp
    trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h
    trunk/Scribus/scribus/colorsetmanager.cpp
    trunk/Scribus/scribus/desaxe/digester.cpp
    trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
    trunk/Scribus/scribus/downloadmanager/scdlthread.h
    trunk/Scribus/scribus/fileloader.cpp
    trunk/Scribus/scribus/fontlistmodel.cpp
    trunk/Scribus/scribus/fonts/cff.cpp
    trunk/Scribus/scribus/fonts/cff.h
    trunk/Scribus/scribus/fonts/fontfeatures.cpp
    trunk/Scribus/scribus/fonts/fontfeatures.h
    trunk/Scribus/scribus/fonts/ftface.cpp
    trunk/Scribus/scribus/fonts/ftface.h
    trunk/Scribus/scribus/fonts/scface.cpp
    trunk/Scribus/scribus/fonts/scface.h
    trunk/Scribus/scribus/fonts/scface_ps.cpp
    trunk/Scribus/scribus/fonts/scface_ttf.cpp
    trunk/Scribus/scribus/fonts/scface_ttf.h
    trunk/Scribus/scribus/fonts/scfontmetrics.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.h
    trunk/Scribus/scribus/fonts/sfnt.cpp

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp	(original)
+++ trunk/Scribus/scribus/appmodehelper.cpp	Sun Aug  5 06:40:18 2018
@@ -147,7 +147,7 @@
 				scmw->pageSelector->setFocusPolicy(Qt::ClickFocus);
 				(*a_scrActions)["editClearContents"]->setEnabled(false);
 				(*a_scrActions)["editTruncateContents"]->setEnabled(false);
-				scmw->charPalette->setEnabled(false, 0);
+				scmw->charPalette->setEnabled(false, nullptr);
 				if (currItem != nullptr)
 				{
 					currItem->update();
@@ -630,7 +630,7 @@
 			(*a_scrActions)["insertSampleText"]->setEnabled(true);
 			//scrMenuMgr->setMenuEnabled("InsertMark",true);
 
-			if ((currItem->nextInChain() != 0) || (currItem->prevInChain() != 0))
+			if ((currItem->nextInChain() != nullptr) || (currItem->prevInChain() != nullptr))
 			{
 				(*a_scrActions)["itemConvertToBezierCurve"]->setEnabled(false);
 				(*a_scrActions)["itemConvertToImageFrame"]->setEnabled(false);
@@ -641,7 +641,7 @@
 				(*a_scrActions)["toolsUnlinkTextFrame"]->setEnabled(true);
 				(*a_scrActions)["toolsUnlinkTextFrameAndCutText"]->setEnabled(true);
 				// FIXME: once there's one itemtext per story, always enable editcontents
-				if ((currItem->prevInChain() != 0) && (currItem->itemText.length() == 0))
+				if ((currItem->prevInChain() != nullptr) && (currItem->itemText.length() == 0))
 					(*a_scrActions)["toolsEditContents"]->setEnabled(false);
 				else
 					(*a_scrActions)["toolsEditContents"]->setEnabled(true);
@@ -867,10 +867,10 @@
 			if (item1->asTextFrame() && (item2->asPolygon() || item2->asPolyLine() || item2->asSpiral() || item2->asArc() || item2->asRegularPolygon()))
 			{
 				canAttachTextToPath  = true;
-				canAttachTextToPath &= (item1->nextInChain() == 0);
-				canAttachTextToPath &= (item1->prevInChain() == 0);
-				canAttachTextToPath &= (item2->nextInChain() == 0);
-				canAttachTextToPath &= (item2->prevInChain() == 0);
+				canAttachTextToPath &= (item1->nextInChain() == nullptr);
+				canAttachTextToPath &= (item1->prevInChain() == nullptr);
+				canAttachTextToPath &= (item2->nextInChain() == nullptr);
+				canAttachTextToPath &= (item2->prevInChain() == nullptr);
 				canAttachTextToPath &= (!item1->isGroup() && !item2->isGroup());
 			}
 			(*a_scrActions)["itemAttachTextToPath"]->setEnabled(canAttachTextToPath);

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp	(original)
+++ trunk/Scribus/scribus/canvas.cpp	Sun Aug  5 06:40:18 2018
@@ -512,8 +512,7 @@
 					{
 						if ((m_doc->drawAsPreview && !m_doc->editOnPreview) && !ret->isAnnotation())
 							return nullptr;
-						else
-							return ret;
+						return ret;
 					}
 				}
 				return currItem;
@@ -532,9 +531,7 @@
 	qreal right = left + sideLength;
 	qreal top   = frame->yPos() + frame->height() - sideLength;// * 1.5;
 	qreal bottom = top + sideLength;
-	if(mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom)
-		return true;
-	return false;
+	return mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom;
 }
 
 bool Canvas::cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame)
@@ -2179,7 +2176,7 @@
 			for (int lks = 0; lks < m_viewMode.linkedFramesToShow.count(); ++lks)
 			{
 				nextItem = m_viewMode.linkedFramesToShow.at(lks);
-				while (nextItem != 0)
+				while (nextItem != nullptr)
 				{
 					if (nextItem->nextInChain() != nullptr)
 					{

Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp	(original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp	Sun Aug  5 06:40:18 2018
@@ -351,8 +351,8 @@
 		// We do not want to scale the text of a linked frame
 		// as it would alter text in other frames of the string
 		else if((currItem->itemType() == PageItem::TextFrame) 
-				       && (currItem->nextInChain() == 0) 
-				       && (currItem->prevInChain() == 0) 
+					   && (currItem->nextInChain() == nullptr)
+					   && (currItem->prevInChain() == nullptr)
 				       && scaleContent)
 		{
 			double divX = (currItem->width() != 0) ? currItem->width() : 1.0;

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Sun Aug  5 06:40:18 2018
@@ -108,8 +108,7 @@
 
 CanvasMode::~CanvasMode()
 {
-	if (m_panGesture)
-		delete m_panGesture;
+	delete m_panGesture;
 }
 
 CanvasMode* CanvasMode::createForAppMode(ScribusView* view, int appMode)

Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp	Sun Aug  5 06:40:18 2018
@@ -796,13 +796,13 @@
 			{
 				m_view->requestMode(submodePaintingDone);
 				delete dia;
-				dia = 0;
+				dia = nullptr;
 				break;
 			}
 			int numRows = dia->Rows->value();
 			int numColumns = dia->Cols->value();
 			delete dia;
-			dia = 0;
+			dia = nullptr;
 			// Add the table item.
 			// TODO: This should be done in an undo transaction.
 			m_doc->dontResize = true;

Modified: trunk/Scribus/scribus/canvasmode_drawbezier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_drawbezier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.cpp	Sun Aug  5 06:40:18 2018
@@ -148,7 +148,7 @@
 			Selection tempSelection(m_doc, false);
 			tempSelection.addItem(currItem);
 			m_doc->itemSelection_DeleteItem(&tempSelection, true);
-			currItem = 0;
+			currItem = nullptr;
 		}
 	}
 
@@ -189,7 +189,7 @@
 		m_view->stopGesture();
 		undoManager->setUndoEnabled(true);
 		currItem = m_doc->m_Selection->itemAt(0);
-		if (currItem != 0)
+		if (currItem != nullptr)
 			finalizeItem(currItem);
 		if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
 			m_view->requestMode(modeNormal);
@@ -213,7 +213,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);
@@ -444,7 +444,7 @@
 	{
 		undoManager->setUndoEnabled(true);
 		currItem = m_doc->m_Selection->itemAt(0);
-		if (currItem != 0)
+		if (currItem != nullptr)
 		{
 			finalizeItem(currItem);
 		}
@@ -488,7 +488,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);

Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	Sun Aug  5 06:40:18 2018
@@ -322,7 +322,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);

Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	Sun Aug  5 06:40:18 2018
@@ -312,7 +312,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);

Modified: trunk/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_edit.cpp	Sun Aug  5 06:40:18 2018
@@ -287,7 +287,7 @@
 		m_view->update();
 	}
 	mRulerGuide = -1;
-	PageItem * it(0);
+	PageItem * it(nullptr);
 	if (GetItem(&it))
 	{
 		if (it->asTextFrame())
@@ -319,7 +319,7 @@
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
-	PageItem *currItem = 0;
+	PageItem *currItem = nullptr;
 	if (GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame())
 	{
 		//CB if annotation, open the annotation dialog
@@ -943,7 +943,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);

Modified: trunk/Scribus/scribus/canvasmode_editarc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_editarc.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editarc.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editarc.cpp	Sun Aug  5 06:40:18 2018
@@ -67,7 +67,7 @@
 	m_arcPoint = noPointDefined;
 	m_startAngle = m_endAngle = 0;
 
-	vectorDialog = 0;
+	vectorDialog = nullptr;
 }
 
 inline bool CanvasMode_EditArc::GetItem(PageItem** pi)

Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp	Sun Aug  5 06:40:18 2018
@@ -272,7 +272,7 @@
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
 //	m_view->stopDragTimer();
-	PageItem *currItem = 0;
+	PageItem *currItem = nullptr;
 	if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal))
 	{
 		if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal))

Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp	Sun Aug  5 06:40:18 2018
@@ -532,7 +532,7 @@
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
-	PageItem *currItem = 0;
+	PageItem *currItem = nullptr;
 	if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal))
 	{
 		if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal))

Modified: trunk/Scribus/scribus/canvasmode_edittable.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_edittable.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edittable.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_edittable.cpp	Sun Aug  5 06:40:18 2018
@@ -41,7 +41,7 @@
 #endif
 
 CanvasMode_EditTable::CanvasMode_EditTable(ScribusView* view) : CanvasMode(view),
-	m_table(0),
+	m_table(nullptr),
 	m_canvasUpdateTimer(new QTimer(view)),
 	m_longBlink(false),
 	m_cursorVisible(false),

Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.cpp	Sun Aug  5 06:40:18 2018
@@ -448,49 +448,49 @@
 		y = 0.0;
 		return;
 	}
-	else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(0.0 - y) < radius))
+	if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(0.0 - y) < radius))
 	{
 		x = m_currItem->width() / 2.0;
 		y = 0.0;
 		return;
 	}
-	else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(0.0 - y) < radius))
+	if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(0.0 - y) < radius))
 	{
 		x = m_currItem->width();
 		y = 0.0;
 		return;
 	}
-	else if ((qAbs(0.0 - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
+	if ((qAbs(0.0 - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
 	{
 		x = 0.0;
 		y = m_currItem->height() / 2.0;
 		return;
 	}
-	else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
+	if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
 	{
 		x = m_currItem->width() / 2.0;
 		y = m_currItem->height() / 2.0;
 		return;
 	}
-	else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
+	if ((qAbs(m_currItem->width() - x) < radius) && (qAbs((m_currItem->height() / 2.0) - y) < radius))
 	{
 		x = m_currItem->width();
 		y = m_currItem->height() / 2.0;
 		return;
 	}
-	else if ((qAbs(0.0 - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
+	if ((qAbs(0.0 - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
 	{
 		x = 0.0;
 		y = m_currItem->height();
 		return;
 	}
-	else if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
+	if ((qAbs((m_currItem->width() / 2.0) - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
 	{
 		x = m_currItem->width() / 2.0;
 		y = m_currItem->height();
 		return;
 	}
-	else if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
+	if ((qAbs(m_currItem->width() - x) < radius) && (qAbs(m_currItem->height() - y) < radius))
 	{
 		x = m_currItem->width();
 		y = m_currItem->height();

Modified: trunk/Scribus/scribus/canvasmode_framelinks.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_framelinks.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_framelinks.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_framelinks.cpp	Sun Aug  5 06:40:18 2018
@@ -297,7 +297,7 @@
 			SeleItem(m);
 			if (GetItem(&currItem) && (currItem->asTextFrame()))
 			{
-				if (currItem->prevInChain() != 0)
+				if (currItem->prevInChain() != nullptr)
 				{
 					currItem->prevInChain()->unlink();
 				}
@@ -329,7 +329,7 @@
 	if ((m_doc->appMode == modeLinkFrames) || (m_doc->appMode == modeUnlinkFrames))
 	{
 		m_view->updateContents();
-		if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools || m_doc->ElemToLink == 0)
+		if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools || m_doc->ElemToLink == nullptr)
 			m_view->requestMode(submodePaintingDone);
 		return;
 	}

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp	Sun Aug  5 06:40:18 2018
@@ -491,7 +491,7 @@
 	//Make sure the Zoom spinbox and page selector don't have focus if we click on the canvas
 	m_view->m_ScMW->zoomSpinBox->clearFocus();
 	m_view->m_ScMW->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 	{
 		currItem = m_doc->m_Selection->itemAt(0);
 		m_doc->nodeEdit.finishTransaction(currItem);

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp	Sun Aug  5 06:40:18 2018
@@ -151,7 +151,7 @@
 
 void CanvasMode_Normal::mouseDoubleClickEvent(QMouseEvent *m)
 {
-	PageItem *currItem = 0;
+	PageItem *currItem = nullptr;
 	m->accept();
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	if (m_doc->drawAsPreview)
@@ -226,10 +226,10 @@
 					m_view->requestMode(submodeStatusPic);
 				else if (currItem->imageVisible())
 					m_view->requestMode(modeEdit);
- 			}
- 			else if (currItem->itemType() == PageItem::TextFrame)
-			{
- 				m_view->requestMode(modeEdit);
+			}
+			else if (currItem->itemType() == PageItem::TextFrame)
+			{
+				m_view->requestMode(modeEdit);
 			}
 			else
 			{
@@ -492,7 +492,7 @@
 				m_doc->DragP = false;
 				m_doc->leaveDrag = false;
 				m_canvas->m_viewMode.m_MouseButtonPressed = false;
-				m_doc->DraggedElem = 0;
+				m_doc->DraggedElem = nullptr;
 				m_doc->DragElements.clear();
 				m_view->setCursor(QCursor(Qt::ArrowCursor));
 				m_view->updateContents();
@@ -632,8 +632,8 @@
 						if (abs(dX)>abs(dY))
 							dY=0;
 						else
-						if (abs(dY)>abs(dX))
-							dX=0;
+							if (abs(dY)>abs(dX))
+								dX=0;
 						erf=false;
 						dX+=m_dragConstrainInitPtX-qRound(gx);
 						dY+=m_dragConstrainInitPtY-qRound(gy);
@@ -930,7 +930,7 @@
 				m_view->updatesOn(true);
 				m_doc->m_Selection->delaySignalsOff();
 			}
-			if ((currItem && !currItem->locked() && m_frameResizeHandle > 0) == false && (!m_doc->drawAsPreview))
+			if (!(currItem && !currItem->locked() && m_frameResizeHandle > 0) && (!m_doc->drawAsPreview))
 			{
 				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
 			}
@@ -1260,7 +1260,7 @@
 	m_view->m_ScMW->pageSelector->clearFocus();
 	if (m_doc->m_Selection->count() > 0)
 	{
-		if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+		if (m_doc->m_Selection->itemAt(0) != nullptr) // is there the old clip stored for the undo action
 		{
 			currItem = m_doc->m_Selection->itemAt(0);
 			m_doc->nodeEdit.finishTransaction(currItem);
@@ -1763,13 +1763,10 @@
 			m_doc->m_Selection->connectItemToGUI();
 			return true;
 		}
-		else
-		{
-			// If we call startGesture now, a new guide is created each time.
-			// ### could be a weakness to avoid calling it tho.
-// 			m_view->startGesture(guideMoveGesture);
-			m_guideMoveGesture->mouseSelectGuide(m);
-		}
+		// If we call startGesture now, a new guide is created each time.
+		// ### could be a weakness to avoid calling it tho.
+		// 			m_view->startGesture(guideMoveGesture);
+		m_guideMoveGesture->mouseSelectGuide(m);
 	}
 	m_doc->m_Selection->connectItemToGUI();
 	if ( !(m->modifiers() & SELECT_MULTIPLE))
@@ -1794,7 +1791,7 @@
 	QStringList formats;
 	int fmtCode = FORMATID_FIRSTUSER;
 	const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
-	while (fmt != 0)
+	while (fmt != nullptr)
 	{
 		if (fmt->load)
 		{

Modified: trunk/Scribus/scribus/chartablemodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/chartablemodel.cpp
==============================================================================
--- trunk/Scribus/scribus/chartablemodel.cpp	(original)
+++ trunk/Scribus/scribus/chartablemodel.cpp	Sun Aug  5 06:40:18 2018
@@ -36,7 +36,7 @@
 
 QVariant CharTableModel::data(const QModelIndex &index, int role) const
 {
-	if (!index.isValid() || m_doc == 0)
+	if (!index.isValid() || m_doc == nullptr)
 		return QVariant();
 
 	int ix = index.row() * m_cols + index.column();

Modified: trunk/Scribus/scribus/chartableview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/chartableview.cpp
==============================================================================
--- trunk/Scribus/scribus/chartableview.cpp	(original)
+++ trunk/Scribus/scribus/chartableview.cpp	Sun Aug  5 06:40:18 2018
@@ -17,7 +17,7 @@
 
 CharTableView::CharTableView(QWidget * parent)
 		: QTableView(parent),
-		zoom(0)
+		zoom(nullptr)
 {
 	deleteAct = new QAction( tr("Delete"), this);
 	connect(deleteAct, SIGNAL(triggered()), this, SLOT(removeCharacter()));
@@ -137,7 +137,7 @@
 	{
 		zoom->close();
 		delete zoom;
-		zoom = 0;
+		zoom = nullptr;
 	}
 }
 

Modified: trunk/Scribus/scribus/collect4output.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/collect4output.cpp
==============================================================================
--- trunk/Scribus/scribus/collect4output.cpp	(original)
+++ trunk/Scribus/scribus/collect4output.cpp	Sun Aug  5 06:40:18 2018
@@ -32,7 +32,7 @@
 
 CollectForOutput::CollectForOutput(ScribusDoc* doc, QString outputDirectory, bool withFonts, bool withProfiles, bool compressDoc)
 	: QObject(ScCore),
-	m_Doc(0),
+	m_Doc(nullptr),
 	m_outputDirectory(QString::null),
 	profileCount(0),
 	itemCount(0),
@@ -379,16 +379,16 @@
 			QString fontDir  = itf.absolutePath();
 			QString fontFile = itf.fileName();
 			metrics += findFontMetrics(fontDir, fontFile);
-			if ( metrics.size() <= 0 )
+			if ( metrics.empty() )
 			{
 				QDir dir;
 				if (dir.exists(fontDir + "/AFMs"))
 					metrics += findFontMetrics(fontDir + "/AFMs", fontFile);
-				if (dir.exists(fontDir + "/afm") && metrics.size() <= 0)
+				if (dir.exists(fontDir + "/afm") && metrics.empty())
 					metrics += findFontMetrics(fontDir + "/afm", fontFile);
-				if (dir.exists(fontDir + "/Pfm") && metrics.size() <= 0)
+				if (dir.exists(fontDir + "/Pfm") && metrics.empty())
 					metrics += findFontMetrics(fontDir + "/Pfm", fontFile);
-				if (dir.exists(fontDir + "/pfm") && metrics.size() <= 0)
+				if (dir.exists(fontDir + "/pfm") && metrics.empty())
 					metrics += findFontMetrics(fontDir + "/pfm", fontFile);
 			}
 			for (int a = 0; a < metrics.size(); a++)

Modified: trunk/Scribus/scribus/colormgmt/scciedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/scciedata.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/scciedata.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/scciedata.cpp	Sun Aug  5 06:40:18 2018
@@ -24,7 +24,7 @@
 	if (ScCIEData::m_instance)
 	{
 		delete ScCIEData::m_instance;
-		ScCIEData::m_instance = 0;
+		ScCIEData::m_instance = nullptr;
 	}
 }
 

Modified: trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolorspacedata.cpp	Sun Aug  5 06:40:18 2018
@@ -27,11 +27,7 @@
 {
 	ScColorTransform colorTransform;
 	if (m_profile)
-	{
-		colorTransform = m_profile.engine().createTransform(m_profile, m_colorFormat, 
-		                                    outputProfile, outputFormat, renderIntent, 
-											transformFlags);
-	}
+		colorTransform = m_profile.engine().createTransform(m_profile, m_colorFormat, outputProfile, outputFormat, renderIntent, transformFlags);
 	return colorTransform;
 }
 
@@ -105,4 +101,4 @@
 		free(dataBuffer);
 	}
 	return success;
-}
+}

Modified: trunk/Scribus/scribus/colormgmt/sccolortransform.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sccolortransform.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolortransform.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolortransform.cpp	Sun Aug  5 06:40:18 2018
@@ -7,7 +7,7 @@
 
 #include "sccolortransform.h"
 
-ScColorTransform::ScColorTransform() : m_data(NULL)
+ScColorTransform::ScColorTransform() : m_data(nullptr)
 {
 }
 
@@ -32,4 +32,4 @@
 bool ScColorTransform::operator==(const ScColorTransform& other) const
 {
 	return m_data == other.m_data;
-}
+}

Modified: trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolortransformpool.cpp	Sun Aug  5 06:40:18 2018
@@ -15,7 +15,7 @@
 
 }
 
-void ScColorTransformPool::clear(void)
+void ScColorTransformPool::clear()
 {
 	m_pool.clear();
 }
@@ -57,7 +57,7 @@
 
 ScColorTransform ScColorTransformPool::findTransform(const ScColorTransformInfo& info) const
 {
-	ScColorTransform transform(NULL);
+	ScColorTransform transform(nullptr);
 	QList< QWeakPointer<ScColorTransformData> >::ConstIterator it = m_pool.begin();
 	for ( ; it != m_pool.end(); ++it)
 	{
@@ -72,4 +72,4 @@
 		}
 	}
 	return transform;
-}
+}

Modified: trunk/Scribus/scribus/colormgmt/sccolortransformpool.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sccolortransformpool.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sccolortransformpool.h	(original)
+++ trunk/Scribus/scribus/colormgmt/sccolortransformpool.h	Sun Aug  5 06:40:18 2018
@@ -20,7 +20,7 @@
 public:
 	ScColorTransformPool (int engineID);
 
-	void clear(void);
+	void clear();
 	void addTransform(const ScColorTransform& transform, bool force = false);
 	void removeTransform(const ScColorTransform& transform);
 	void removeTransform(const ScColorTransformInfo& info);

Modified: trunk/Scribus/scribus/colormgmt/sce308tables.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sce308tables.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sce308tables.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sce308tables.cpp	Sun Aug  5 06:40:18 2018
@@ -20,7 +20,6 @@
 }
 
 ScE308Table5_D50_2deg::ScE308Table5_D50_2deg()
-                     : ScE308Table()
 {
 	m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] =  0.001;
 	m_wx[370] = 0.001, m_wy[370] = 0.000, m_wz[370] =  0.005;
@@ -76,7 +75,6 @@
 }
 
 ScE308Table5_D50_10deg::ScE308Table5_D50_10deg()
-                     : ScE308Table()
 {
 	m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] =  0.000;
 	m_wx[370] = 0.000, m_wy[370] = 0.000, m_wz[370] =  0.000;
@@ -132,7 +130,6 @@
 }
 
 ScE308Table6_D50_2deg::ScE308Table6_D50_2deg()
-                     : ScE308Table()
 {
 	m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] =  0.000;
 	m_wx[370] = 0.001, m_wy[370] = 0.000, m_wz[370] =  0.005;
@@ -188,7 +185,6 @@
 }
 
 ScE308Table6_D50_10deg::ScE308Table6_D50_10deg()
-                     : ScE308Table()
 {
 	m_wx[360] = 0.000, m_wy[360] = 0.000, m_wz[360] =  0.000;
 	m_wx[370] = 0.000, m_wy[370] = 0.000, m_wz[370] =  0.000;
@@ -241,4 +237,4 @@
 	m_wx[760] = 0.001, m_wy[760] = 0.000, m_wz[760] =  0.000;
 	m_wx[770] = 0.000, m_wy[770] = 0.000, m_wz[770] =  0.000;
 	m_wx[780] = 0.000, m_wy[780] = 0.000, m_wz[780] =  0.000;
-}
+}

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colormgmtengineimpl.cpp	Sun Aug  5 06:40:18 2018
@@ -58,7 +58,7 @@
 		QFileInfo fi(directory + "/" + file);
 		if (fi.isDir() && !recursive)
 			continue;
-		else if (fi.isDir() && !file.startsWith('.'))
+		if (fi.isDir() && !file.startsWith('.'))
 		{
 			QList<ScColorProfileInfo> profileInfos2 = getAvailableProfileInfo(fi.filePath()+"/", true);
 			profileInfos.append(profileInfos2);

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colorprofileimpl.cpp	Sun Aug  5 06:40:18 2018
@@ -81,7 +81,7 @@
 	return m_productDescription;
 }
 
-void ScLcms2ColorProfileImpl::closeProfile(void)
+void ScLcms2ColorProfileImpl::closeProfile()
 {
 	if (m_profileHandle)
 	{

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.cpp	Sun Aug  5 06:40:18 2018
@@ -44,7 +44,7 @@
 	return false;
 }
 
-void ScLcms2ColorTransformImpl::deleteTransform(void)
+void ScLcms2ColorTransformImpl::deleteTransform()
 {
 	if (m_transformHandle)
 	{

Modified: trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h
==============================================================================
--- trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h	(original)
+++ trunk/Scribus/scribus/colormgmt/sclcms2colortransformimpl.h	Sun Aug  5 06:40:18 2018
@@ -28,7 +28,7 @@
 protected:
 	cmsHTRANSFORM m_transformHandle;
 
-	void deleteTransform(void);
+	void deleteTransform();
 };
 
 #endif

Modified: trunk/Scribus/scribus/colorsetmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/colorsetmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/colorsetmanager.cpp	(original)
+++ trunk/Scribus/scribus/colorsetmanager.cpp	Sun Aug  5 06:40:18 2018
@@ -110,9 +110,9 @@
 						lf.fromQColor(QColor(pg.attribute("RGB")));
 					else
 					{
-						double L = pg.attribute("L", 0).toDouble();
-						double a = pg.attribute("A", 0).toDouble();
-						double b = pg.attribute("B", 0).toDouble();
+						double L = pg.attribute("L", nullptr).toDouble();
+						double a = pg.attribute("A", nullptr).toDouble();
+						double b = pg.attribute("B", nullptr).toDouble();
 						lf.setLabColor(L, a, b);
 					}
 					if (pg.hasAttribute("Spot"))
@@ -329,7 +329,7 @@
 		const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150IMPORT);
 		if (fmt)
 		{
-			fmt->setupTargets(doc, 0, doc->scMW(), 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
+			fmt->setupTargets(doc, nullptr, doc->scMW(), nullptr, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
 			fmt->loadPalette(paletteFileName);
 		}
 		else

Modified: trunk/Scribus/scribus/desaxe/digester.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/desaxe/digester.cpp
==============================================================================
--- trunk/Scribus/scribus/desaxe/digester.cpp	(original)
+++ trunk/Scribus/scribus/desaxe/digester.cpp	Sun Aug  5 06:40:18 2018
@@ -202,15 +202,15 @@
 {
 	if (pattern1 == "")
 		return pattern2;
-	else if (pattern2 == "")
+	if (pattern2 == "")
 		return pattern1;
-	else if ( (pattern1[pattern1.length()-1] != '/') && (pattern2[0] != '/') )
+	if ( (pattern1[pattern1.length()-1] != '/') && (pattern2[0] != '/') )
 		// insert "/" as separator
 		return pattern1 + "/" + pattern2;
-	else if ( (pattern1[pattern1.length()-1]=='/') || (pattern2[0]=='/') )
+	if ( (pattern1[pattern1.length()-1]=='/') || (pattern2[0]=='/') )
 		return pattern1 + pattern2;
-	else // cut off one "/"
-		return pattern1 + QString::fromStdString(std::string(static_cast<const std::string&>(pattern2.toStdString()), 1, std::string::npos));
+	// cut off one "/"
+	return pattern1 + QString::fromStdString(std::string(static_cast<const std::string&>(pattern2.toStdString()), 1, std::string::npos));
 }
 
 
@@ -225,13 +225,11 @@
 	if (dfa) 
 	{
 		std::set<dfa_state_t> morituri(dfa->states());
-		for (auto i = morituri.begin(); i != morituri.end(); ++i) {
+		for (auto i = morituri.begin(); i != morituri.end(); ++i)
 			delete *i;
-		}
 		delete dfa;
 	}
 }
-
 
 void RuleState::addRule(const Xml_string& pattern, Action action)
 {

Modified: trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/downloadmanager/scdlthread.cpp
==============================================================================
--- trunk/Scribus/scribus/downloadmanager/scdlthread.cpp	(original)
+++ trunk/Scribus/scribus/downloadmanager/scdlthread.cpp	Sun Aug  5 06:40:18 2018
@@ -14,7 +14,7 @@
 ScDLThread::ScDLThread(QObject *parent) : QThread(parent),
 	m_downloadedCount(0), m_totalCount(0)
 {
-	m_currentDownload = 0;
+	m_currentDownload = nullptr;
 	connect(this, SIGNAL(runSignal()), this, SLOT(runSlot()));
 }
 
@@ -128,7 +128,7 @@
 	m_currentDownload = m_manager.get(request);
 	connect(m_currentDownload, SIGNAL(finished()), this, SLOT(downloadFinished()));
 	connect(m_currentDownload, SIGNAL(readyRead()), this, SLOT(downloadReadyRead()));
-	connect(m_currentDownload, SIGNAL(downloadProgress(qint64, qint64)), this, SIGNAL(fileDownloadProgress(qint64, qint64)));
+	connect(m_currentDownload, SIGNAL(downloadProgress(qint64,qint64)),this,SIGNAL(fileDownloadProgress(qint64,qint64)));
 
 	//qDebug()<<"Downloading:"<<urlPair.first.toEncoded().constData();
 }
@@ -204,16 +204,11 @@
 	startNextDownload();
 }
 
-bool ScDLThread::urlOK(QUrl url)
+bool ScDLThread::urlOK(const QUrl& url)
 {
 	//TODO: Add some more URL checks
-	if (!url.isValid() || url.isEmpty() || url.host().isEmpty())
-	{
-		//qDebug()<<"URL invalid:"<<url;
-		return false;
-	}
-	return true;
-}
-
-
-
+	return !(!url.isValid() || url.isEmpty() || url.host().isEmpty());
+}
+
+
+

Modified: trunk/Scribus/scribus/downloadmanager/scdlthread.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/downloadmanager/scdlthread.h
==============================================================================
--- trunk/Scribus/scribus/downloadmanager/scdlthread.h	(original)
+++ trunk/Scribus/scribus/downloadmanager/scdlthread.h	Sun Aug  5 06:40:18 2018
@@ -39,7 +39,7 @@
 		void runSlot();
 
 	private:
-		bool urlOK(QUrl url);
+		bool urlOK(const QUrl& url);
 		QStringList m_urlList;
 		QFile m_output;
 		QQueue<QPair<QUrl, QString> > m_downloadQueue;

Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp	(original)
+++ trunk/Scribus/scribus/fileloader.cpp	Sun Aug  5 06:40:18 2018
@@ -59,7 +59,7 @@
  \retval None
  */
 FileLoader::FileLoader(const QString & fileName) :
-	QObject(0),
+	QObject(nullptr),
 	formatSLA12x(LoadSavePlugin::getFormatById(FORMATID_SLA12XIMPORT)),
 	formatSLA13x(LoadSavePlugin::getFormatById(FORMATID_SLA13XIMPORT)),
 	formatSLA134(LoadSavePlugin::getFormatById(FORMATID_SLA134IMPORT)),
@@ -132,7 +132,7 @@
 			QString ext = it->fileExtensions[a].toLower();
 			if (lwrFileName.endsWith("." + ext)) // Beware of file names containing multiple points
 			{
-				if (it->plug->fileSupported(0, m_fileName))
+				if (it->plug->fileSupported(nullptr, m_fileName))
 				{
 					ret = it->formatId;
 					found = true;
@@ -157,7 +157,7 @@
 				QString exts = it->fileExtensions[a].toLower();
 				if (ext == exts)
 				{
-					if (it->plug->fileSupported(0, m_fileName))
+					if (it->plug->fileSupported(nullptr, m_fileName))
 					{
 						ret = it->formatId;
 						found = true;
@@ -191,7 +191,7 @@
 		}
 		if (m_fileType == FORMATID_SLA13XIMPORT || m_fileType == FORMATID_SLA134IMPORT || m_fileType == FORMATID_SLA150IMPORT)
 		{
-			it->plug->setupTargets(currDoc, 0, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
+			it->plug->setupTargets(currDoc, nullptr, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
 			ret = it->plug->loadPage(m_fileName, PageToLoad, Mpage, renamedPageName);
 // 			if (ret)
 // 				it->plug->getReplacedFontData(newReplacement, ReplacedFonts, dummyScFaces);
@@ -256,7 +256,7 @@
 			case FORMATID_SLA134IMPORT:
 			case FORMATID_SLA150IMPORT:
 				{
-					it->setupTargets(currDoc, 0, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
+					it->setupTargets(currDoc, nullptr, currDoc->scMW(), currDoc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
 					ret=it->loadFile(m_fileName, LoadSavePlugin::lfCreateDoc);
 // 					if (ret)
 // 						it->getReplacedFontData(newReplacement, ReplacedFonts, dummyScFaces);
@@ -290,7 +290,7 @@
 	QList<FileFormat>::const_iterator it;
 	if (findFormat(m_fileType, it))
 	{
-		it->plug->setupTargets(doc, 0, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
+		it->plug->setupTargets(doc, nullptr, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
 		return it->readStyles(m_fileName, doc, docParagraphStyles);
 	}
 	return false;
@@ -301,7 +301,7 @@
 	QList<FileFormat>::const_iterator it;
 	if (findFormat(m_fileType, it))
 	{
-		it->plug->setupTargets(doc, 0, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
+		it->plug->setupTargets(doc, nullptr, doc->scMW(), doc->scMW()->mainWindowProgressBar, &(m_prefsManager->appPrefs.fontPrefs.AvailFonts));
 		return it->readCharStyles(m_fileName, doc, docCharStyles);
 	}
 	return false;

Modified: trunk/Scribus/scribus/fontlistmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fontlistmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/fontlistmodel.cpp	(original)
+++ trunk/Scribus/scribus/fontlistmodel.cpp	Sun Aug  5 06:40:18 2018
@@ -211,15 +211,13 @@
 	{
 		if (isLive())
 			return (font.usable() ? Qt::Checked : Qt::Unchecked);
-		else
-			return (m_enabledFonts[index.row()] ? Qt::Checked : Qt::Unchecked);
+		return (m_enabledFonts[index.row()] ? Qt::Checked : Qt::Unchecked);
 	}
 	if (role == Qt::CheckStateRole && index.column() == FontListModel::FontSubset)
 	{
 		if (isLive())
 			return (font.subset() ? Qt::Checked : Qt::Unchecked);
-		else
-			return ((m_embedFlags[index.row()] & SubsetPDF) ? Qt::Checked : Qt::Unchecked);
+		return ((m_embedFlags[index.row()] & SubsetPDF) ? Qt::Checked : Qt::Unchecked);
 	}
 
 	return QVariant();

Modified: trunk/Scribus/scribus/fonts/cff.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/cff.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/cff.cpp	(original)
+++ trunk/Scribus/scribus/fonts/cff.cpp	Sun Aug  5 06:40:18 2018
@@ -88,16 +88,11 @@
 			int idx = id & 0xff;
 			if (idx >= 0 && idx <= 38)
 				return cffDictKeys0c[idx];
-			else
-				return "";
-		}
-		else
-		{
-			if ( /* id >= 0 && */  id <= 21)
-				return cffDictKeys[id];
-			else
-				return "";
-		}
+			return "";
+		}
+		if ( /* id >= 0 && */  id <= 21)
+			return cffDictKeys[id];
+		return "";
 	}
 	
 	static const char* stdStrings[] = {
@@ -1083,7 +1078,7 @@
 					write(out, "    <Encoding>\n    ");
 					pos = encOffset;
 					QList<uint> enc = readEncoding(pos);
-					write(out, readSegment(encOffset, pos-encOffset).toHex());
+					write(out, readSegment(encOffset, pos - encOffset).toHex());
 					write(out, "\n    </Encoding>\n");
 				}
 				else
@@ -1155,12 +1150,11 @@
 	{
 		if (dataLength < 255)
 			return 1;
-		else if (dataLength < 65535)
+		if (dataLength < 65535)
 			return 2;
-		else if (dataLength < 0xFFFFFF)
+		if (dataLength < 0xFFFFFF)
 			return 3;
-		else
-			return 4;
+		return 4;
 	}
 	
 	
@@ -1715,7 +1709,7 @@
 		uint privateOffset = result.writeSegment(privateBytes);
 		
 		// write local subr
-		if (localSubrs.size() > 0)
+		if (!localSubrs.empty())
 		{
 			uint localSubrOffset = result.writeSegment(makeIndex(localSubrs));
 

Modified: trunk/Scribus/scribus/fonts/cff.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/cff.h
==============================================================================
--- trunk/Scribus/scribus/fonts/cff.h	(original)
+++ trunk/Scribus/scribus/fonts/cff.h	Sun Aug  5 06:40:18 2018
@@ -137,7 +137,8 @@
 	};
 	
 	
-	enum CFF_Variant_Type {
+	enum CFF_Variant_Type
+	{
 		cff_varnt_Error    = 0,
 		cff_varnt_Bool     = 1,
 		cff_varnt_Card     = 2,
@@ -149,17 +150,20 @@
 	};
 
 	
-	struct CFF_Number {
+	struct CFF_Number
+	{
 		long long   card;
 		int         exponent;
 		uchar       type;
 		bool        isCardinal() const;
 		double      toDouble() const;
 		int         toCardinal() const;
-	};
-	
-
-	struct CFF_Variant {
+		CFF_Number() : card(0),exponent(0),type(0) {};
+	};
+	
+
+	struct CFF_Variant
+	{
 		uchar type;
 		QList<CFF_Number> array;
 		CFF_Variant()                      : type(cff_varnt_Error) {}

Modified: trunk/Scribus/scribus/fonts/fontfeatures.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/fontfeatures.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/fontfeatures.cpp	(original)
+++ trunk/Scribus/scribus/fonts/fontfeatures.cpp	Sun Aug  5 06:40:18 2018
@@ -65,7 +65,7 @@
 	                                  FontFeatures::StyleSet11 + FontFeatures::StyleSet12 + FontFeatures::StyleSet13 + FontFeatures::StyleSet14 + FontFeatures::StyleSet15 +
 	                                  FontFeatures::StyleSet16 + FontFeatures::StyleSet17 + FontFeatures::StyleSet18 + FontFeatures::StyleSet19 + FontFeatures::StyleSet20;
 
-quint64 FontFeatures::fontFlagsFromList(QStringList features)
+quint64 FontFeatures::fontFlagsFromList(const QStringList& features)
 {
 	quint64 flags = 0;
 
@@ -165,7 +165,7 @@
 	return flags;
 }
 
-quint64 FontFeatures::textFlagsFromList(QStringList features)
+quint64 FontFeatures::textFlagsFromList(const QStringList& features)
 {
 	quint64 flags = 0;
 	flags |= CommonLigatures;
@@ -265,4 +265,4 @@
 	}
 
 	return flags;
-}
+}

Modified: trunk/Scribus/scribus/fonts/fontfeatures.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/fontfeatures.h
==============================================================================
--- trunk/Scribus/scribus/fonts/fontfeatures.h	(original)
+++ trunk/Scribus/scribus/fonts/fontfeatures.h	Sun Aug  5 06:40:18 2018
@@ -65,8 +65,8 @@
 	static quint64 NumeralFractionsMask;
 	static quint64 StyleSetsMask;
 
-	static quint64 fontFlagsFromList(QStringList features);
-	static quint64 textFlagsFromList(QStringList features);
+	static quint64 fontFlagsFromList(const QStringList& features);
+	static quint64 textFlagsFromList(const QStringList& features);
 };
 
 #endif

Modified: trunk/Scribus/scribus/fonts/ftface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/ftface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.cpp	(original)
+++ trunk/Scribus/scribus/fonts/ftface.cpp	Sun Aug  5 06:40:18 2018
@@ -40,23 +40,21 @@
    unicode emulate: spaces, hyphen, ligatures?, diacritics?
  *****/
 
-FtFace::FtFace(QString fam, QString sty, QString vari, QString scname, 
-			   QString psname, QString path, int face, QStringList features)
-: ScFaceData(),
-	m_face(nullptr),
-	m_isBold(false),
-	m_isItalic(false),
-	m_encoding(0.0),
-	m_uniEM(0.0),
-	m_ascent(0.0),
-	m_descent(0.0),
-	m_height(0.0),
-	m_xHeight(0.0),
-	m_capHeight(0.0),
-	m_maxAdvanceWidth(0.0),
-	m_underlinePos(0.0),
-	m_strikeoutPos(0.0),
-	m_strokeWidth(0.0)
+FtFace::FtFace(const QString& fam, const QString& sty, const QString& vari, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features)
+	: 	m_face(nullptr),
+	  m_isBold(false),
+	  m_isItalic(false),
+	  m_encoding(0.0),
+	  m_uniEM(0.0),
+	  m_ascent(0.0),
+	  m_descent(0.0),
+	  m_height(0.0),
+	  m_xHeight(0.0),
+	  m_capHeight(0.0),
+	  m_maxAdvanceWidth(0.0),
+	  m_underlinePos(0.0),
+	  m_strikeoutPos(0.0),
+	  m_strokeWidth(0.0)
 {
 	family = fam;
 	style = sty;
@@ -66,10 +64,9 @@
 	fontFile = path;
 	faceIndex = face;
 	fontFeatures = features;
-	if (!m_library) {
+	if (!m_library)
 		if (FT_Init_FreeType( &m_library ))
 			sDebug(QObject::tr("Freetype2 library not available"));
-	}
 }
 
 
@@ -78,16 +75,18 @@
 }
 
 
-FT_Face FtFace::ftFace() const {
-	if (!m_face) {
-		if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) {
+FT_Face FtFace::ftFace() const
+{
+	if (!m_face)
+	{
+		if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face ))
+		{
 			status = ScFace::BROKEN;
 			m_face = nullptr;
 			sDebug(QObject::tr("Font %1(%2) is broken").arg(fontFile).arg(faceIndex));
 		}
-		else {
+		else
 			load();
-		}
 	}
 	return m_face;
 }
@@ -97,7 +96,8 @@
 	ScFaceData::load();
 
 	if (!m_face) {
-		if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face )) {
+		if (FT_New_Face( m_library, QFile::encodeName(fontFile), faceIndex, & m_face ))
+		{
 			status = ScFace::BROKEN;
 			m_face = nullptr;
 			sDebug(QObject::tr("Font %1(%2) is broken").arg(fontFile).arg(faceIndex));

Modified: trunk/Scribus/scribus/fonts/ftface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/ftface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/ftface.h	(original)
+++ trunk/Scribus/scribus/fonts/ftface.h	Sun Aug  5 06:40:18 2018
@@ -53,8 +53,8 @@
 struct SCRIBUS_API FtFace : public ScFace::ScFaceData
 {
 
-	FtFace(QString fam, QString sty, QString variant, QString scname,
-		   QString psname, QString path, int face, QStringList features);
+	FtFace(const QString& fam, const QString& sty, const QString& variant, const QString& scname,
+		   const QString& psname, const QString& path, int face, const QStringList& features);
 
 	FT_Face ftFace() const;
 

Modified: trunk/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface.cpp	Sun Aug  5 06:40:18 2018
@@ -128,14 +128,14 @@
 {
 	GlyphMetrics res;
 	if (gl >= CONTROL_GLYPHS)
-	{	res.width   = glyphWidth(gl, sz);
+	{
+		res.width   = glyphWidth(gl, sz);
 		res.ascent  = (gl == 0? ascent(sz) : 0);
 		res.descent = 0;
 		return res;
 	}
-	else if (! m_glyphWidth.contains(gl)) {
+	if (! m_glyphWidth.contains(gl))
 		loadGlyph(gl);
-	}
 	const struct GlyphData & data(m_glyphOutline[gl]);
 	res.width = data.bbox_width * sz;
 	res.ascent = data.bbox_ascent * sz;
@@ -148,9 +148,8 @@
 {
 	if (gl >= CONTROL_GLYPHS)
 		return 0.0;
-	else if (! m_glyphWidth.contains(gl)) {
+	if (! m_glyphWidth.contains(gl))
 		loadGlyph(gl);
-	}
 	return m_glyphWidth[gl] * size;
 }
 
@@ -159,9 +158,8 @@
 { 
 	if (gl >= CONTROL_GLYPHS)
 		return FPointArray();
-	else if (! m_glyphWidth.contains(gl)) {
+	if (! m_glyphWidth.contains(gl))
 		loadGlyph(gl);
-	}
 	FPointArray res = m_glyphOutline[gl].Outlines.copy();
 	if (sz != 1.0)
 		res.scale(sz, sz);
@@ -173,9 +171,8 @@
 {
 	if (gl >= CONTROL_GLYPHS)
 		return FPoint(0,0);
-	else if (! m_glyphWidth.contains(gl)) {
+	if (! m_glyphWidth.contains(gl))
 		loadGlyph(gl);
-	}
 	const struct GlyphData & res(m_glyphOutline[gl]);
 	return FPoint(res.x, res.y) * sz; 
 }
@@ -219,10 +216,11 @@
 
 ScFace::~ScFace()
 {
-	if ( m_m && --(m_m->refs) == 0 ) {
+	if ( m_m && --(m_m->refs) == 0 )
+	{
 		m_m->unload();
 		delete m_m;
-		m_m = 0;
+		m_m = nullptr;
 	}
 }
 
@@ -233,7 +231,8 @@
 	{
 		if (other.m_m)
 			++(other.m_m->refs);
-		if ( m_m && --(m_m->refs) == 0 ) {
+		if ( m_m && --(m_m->refs) == 0 )
+		{
 			m_m->unload();
 			delete m_m;
 		}
@@ -432,14 +431,13 @@
 	if (ch == SpecialChars::LINEBREAK || ch == SpecialChars::PARSEP 
 		|| ch == SpecialChars::FRAMEBREAK || ch == SpecialChars::COLBREAK 
 		|| ch == SpecialChars::TAB || ch == SpecialChars::SHYPHEN
-		 || ch == SpecialChars::ZWSPACE || ch == SpecialChars::ZWNBSPACE || ch==SpecialChars::OBJECT)
+		|| ch == SpecialChars::ZWSPACE || ch == SpecialChars::ZWNBSPACE || ch==SpecialChars::OBJECT)
 		return CONTROL_GLYPHS + ch;
-	else if (ch == SpecialChars::NBSPACE)
+	if (ch == SpecialChars::NBSPACE)
 		return  m_m->char2CMap(' ');
-	else if(ch == SpecialChars::NBHYPHEN)
+	if(ch == SpecialChars::NBHYPHEN)
 		return hyphenGlyph();
-	else
-		return 0;
+	return 0;
 }
 ScFace::gid_type ScFace::hyphenGlyph() const
 {
@@ -473,9 +471,8 @@
 
 ScFace::gid_type ScFace::char2CMap(uint ch) const
 {
-	if (m_m->status == ScFace::UNKNOWN) {
-		m_m->load();
-	}
+	if (m_m->status == ScFace::UNKNOWN)
+		m_m->load();
 	
 	if (ch == SpecialChars::SHYPHEN)
 		return emulateGlyph(ch);
@@ -484,8 +481,7 @@
 
 	if (gl == 0)
 		return emulateGlyph(ch);
-	else
-		return gl;
+	return gl;
 }
 
 
@@ -493,56 +489,50 @@
 {
 	if (!usable())
 		return false;
-	else {
-		gid_type gl = char2CMap(ch.unicode());    //  calls load()
-		if (gl >= CONTROL_GLYPHS)   //  those are always empty
-			return true;
-		else if (gl != 0) {
-			m_m->loadGlyph(gl);
-			return ! m_m->m_glyphOutline[gl].broken; 
-		}
-		else  {
-			return false;
-		}
-	}
+	gid_type gl = char2CMap(ch.unicode());    //  calls load()
+	if (gl >= CONTROL_GLYPHS)   //  those are always empty
+		return true;
+	if (gl != 0)
+	{
+		m_m->loadGlyph(gl);
+		return !m_m->m_glyphOutline[gl].broken;
+	}
+	return false;
 }
 
 bool ScFace::embedFont(QByteArray &str)
 {
-	if (m_m->status == ScFace::UNKNOWN) {
-		m_m->load();
-	}
+	if (m_m->status == ScFace::UNKNOWN)
+		m_m->load();
 	return m_m->embedFont(str);
 }
 
 
 bool ScFace::glyphNames(FaceEncoding& gList)
 {
-	if (m_m->status == ScFace::UNKNOWN) {
-		m_m->load();
-	}
+	if (m_m->status == ScFace::UNKNOWN)
+		m_m->load();
 	return m_m->glyphNames(gList);
 }
 
 
 void ScFace::rawData(QByteArray & bb)
 {
-	if (m_m->status == ScFace::UNKNOWN) {
-		m_m->load();
-	}
+	if (m_m->status == ScFace::UNKNOWN)
+		m_m->load();
 	m_m->rawData(bb);
 }
 
 void ScFace::checkAllGlyphs()
 {
-	if (m_m->status == ScFace::UNKNOWN) {
-		m_m->load();
-	}
-	if (m_m->status != ScFace::LOADED) {
+	if (m_m->status == ScFace::UNKNOWN)
+		m_m->load();
+	if (m_m->status != ScFace::LOADED)
 		return;
-	}
-	for (gid_type gl=0; gl <= m_m->maxGlyph; ++gl) {
-		if (! m_m->m_glyphWidth.contains(gl)) {
+	for (gid_type gl=0; gl <= m_m->maxGlyph; ++gl)
+	{
+		if (! m_m->m_glyphWidth.contains(gl))
+		{
 			m_m->loadGlyph(gl);
 			m_m->m_glyphWidth.remove(gl);
 			m_m->m_glyphOutline.remove(gl);

Modified: trunk/Scribus/scribus/fonts/scface.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scface.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.h	(original)
+++ trunk/Scribus/scribus/fonts/scface.h	Sun Aug  5 06:40:18 2018
@@ -33,7 +33,8 @@
 
 class CharStyle;
 
-struct GlyphMetrics {
+struct GlyphMetrics
+{
 	qreal width;
 	qreal ascent;
 	qreal descent;

Modified: trunk/Scribus/scribus/fonts/scface_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scface_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ps.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface_ps.cpp	Sun Aug  5 06:40:18 2018
@@ -24,16 +24,16 @@
 	metricsFiles += findFontMetrics(fontDir, fontFile);
 
 	//if no metrics found look in afm and pfm subdirs
-	if ( metricsFiles.size() <= 0 )
+	if ( metricsFiles.empty() )
 	{
 		QDir dir;
 		if (dir.exists(fontDir + "/AFMs"))
 			metricsFiles += findFontMetrics(fontDir + "/AFMs", fontFile);
-		if (dir.exists(fontDir + "/afm") && metricsFiles.size() <= 0)
+		if (dir.exists(fontDir + "/afm") && metricsFiles.empty())
 			metricsFiles += findFontMetrics(fontDir + "/afm", fontFile);
-		if (dir.exists(fontDir + "/Pfm") && metricsFiles.size() <= 0)
+		if (dir.exists(fontDir + "/Pfm") && metricsFiles.empty())
 			metricsFiles += findFontMetrics(fontDir + "/Pfm", fontFile);
-		if (dir.exists(fontDir + "/pfm") && metricsFiles.size() <= 0)
+		if (dir.exists(fontDir + "/pfm") && metricsFiles.empty())
 			metricsFiles += findFontMetrics(fontDir + "/pfm", fontFile);
 	}
 	return metricsFiles;
@@ -82,7 +82,7 @@
 {
 	bool metricsFound = false;
 	QStringList fontMetrics = findFontMetrics(fontPath);
-	if (fontMetrics.size() > 0)
+	if (!fontMetrics.empty())
 	{
 		bool brokenMetric = false;
 		QString metricsFile;

Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp	Sun Aug  5 06:40:18 2018
@@ -21,7 +21,7 @@
 #include FT_TRUETYPE_IDS_H
 
 
-ScFace_ttf::ScFace_ttf (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face, QStringList features )
+ScFace_ttf::ScFace_ttf (const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features )
 		: FtFace (fam, sty, alt, scname, psname, path, face, features)
 {
 	formatCode = ScFace::SFNT;
@@ -166,7 +166,8 @@
 {
     QByteArray bb;
     FtFace::rawData(bb);
-	if (formatCode == ScFace::TYPE42) {
+	if (formatCode == ScFace::TYPE42)
+	{
 		//easy:
 		str = bb;
 		return true;
@@ -180,13 +181,12 @@
 	FT_ULong  charcode;
 	FT_UInt   gindex;
 	FT_Face face = ftFace();
-	if (!face) {
-		return false;
-	}
+	if (!face)
+		return false;
 	const FT_Stream fts = face->stream;
-	if (ftIOFunc(fts, 0L, NULL, 0)) {
+	if (ftIOFunc(fts, 0L, nullptr, 0))
 		return(false);
-	}
+
 	str+="%!PS-TrueTypeFont\n";
 	str+="11 dict begin\n";
 	str+="/FontName /" + psName + " def\n";
@@ -234,7 +234,8 @@
 			poso = 0;
 			str += "00\n>";
 		}
-		else {
+		else
+		{
 			sDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(fontFile));
 			str += "\n] def\n";
 			status = qMax(status,ScFace::BROKENGLYPHS);

Modified: trunk/Scribus/scribus/fonts/scface_ttf.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scface_ttf.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.h	(original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.h	Sun Aug  5 06:40:18 2018
@@ -21,7 +21,7 @@
 class SCRIBUS_API ScFace_ttf : public FtFace
 {
 public:
-	ScFace_ttf (QString fam, QString sty, QString alt, QString scname, QString psname, QString path, int face, QStringList features);
+	ScFace_ttf (const QString& fam, const QString& sty, const QString& alt, const QString& scname, const QString& psname, const QString& path, int face, const QStringList& features);
 	~ScFace_ttf();
 
 	void load () const;

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.cpp	Sun Aug  5 06:40:18 2018
@@ -81,7 +81,7 @@
 // the following line, assuming that the default charmap has the index 0
 	int defaultchmap = 0;
 	FT_ULong dbgInfo = 0;
-	FT_Load_Sfnt_Table( face, FT_MAKE_TAG('p','o','s','t'), 0, NULL, &dbgInfo );
+	FT_Load_Sfnt_Table( face, FT_MAKE_TAG('p','o','s','t'), 0, nullptr, &dbgInfo );
 	qDebug() << "setBestEncoding for " << FT_Get_Postscript_Name(face) << " with " << face->num_glyphs << "glyphs, hasNames=" << FT_HAS_GLYPH_NAMES(face) << ", POST size=" << dbgInfo ;
 	for(int u = 0; u < face->num_charmaps; u++)
 	{
@@ -108,7 +108,7 @@
 			qDebug() << "found Custom enc for" << face->family_name << face->style_name;
 			break;
 		}
-		else if (charmap->encoding == FT_ENCODING_MS_SYMBOL)
+		if (charmap->encoding == FT_ENCODING_MS_SYMBOL)
 		{
 			qDebug() << "found Symbol enc for" << face->family_name << face->style_name;
 
@@ -228,7 +228,7 @@
 }
 
 
-QPixmap FontSample(const ScFace& fnt, int s, QVector<uint> ts, QColor back, bool force)
+QPixmap FontSample(const ScFace& fnt, int s, QVector<uint> ts, const QColor& back, bool force)
 {
 	FT_Face face;
 	FT_Library library;
@@ -474,15 +474,18 @@
 	QString result;
 	if (adobeGlyphNames.contains(charcode))
 		return adobeGlyphNames[charcode];
-	else if (charcode < 0x10000) {
+	if (charcode < 0x10000)
+	{
 		result = QString("uni") + HEX[charcode>>12 & 0xF] 
 		                        + HEX[charcode>> 8 & 0xF] 
 		                        + HEX[charcode>> 4 & 0xF] 
 		                        + HEX[charcode     & 0xF];
 	}
-	else  {
+	else
+	{
 		result = QString("u");
-		for (int i= 28; i >= 0; i-=4) {
+		for (int i= 28; i >= 0; i-=4)
+		{
 			if (charcode & (0xF << i))
 				result += HEX[charcode >> i & 0xF];
 		}

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/scfontmetrics.h
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.h	(original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.h	Sun Aug  5 06:40:18 2018
@@ -33,7 +33,7 @@
 
 FPointArray SCRIBUS_API traceChar(FT_Face face, ScFace::ucs4_type chr, int chs, qreal *x, qreal *y, bool *err);
 FPointArray SCRIBUS_API traceGlyph(FT_Face face, ScFace::gid_type gl, int chs, qreal *x, qreal *y, bool *err);
-QPixmap     SCRIBUS_API FontSample(const ScFace& fnt, int s, QVector<uint> ts, QColor back, bool force = false);
+QPixmap     SCRIBUS_API FontSample(const ScFace& fnt, int s, QVector<uint> ts, const QColor& back, bool force = false);
 //bool        SCRIBUS_API GlyphNames(const FtFace& fnt, ScFace::FaceEncoding& GList);
 
 #endif

Modified: trunk/Scribus/scribus/fonts/sfnt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22599&path=/trunk/Scribus/scribus/fonts/sfnt.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/sfnt.cpp	(original)
+++ trunk/Scribus/scribus/fonts/sfnt.cpp	Sun Aug  5 06:40:18 2018
@@ -311,24 +311,16 @@
 {
 	if (m_names.length() > 0)
 		return m_names.length();
-	else
-		return post_format10_names_count;
+	return post_format10_names_count;
 }
 
 QString PostTable::nameFor(uint glyph) const
 {
 	if (glyph < (uint) m_names.length())
-	{
 		return m_names[glyph];
-	}
-	else if (glyph < sfnt::post_format10_names_count)
-	{
+	if (glyph < sfnt::post_format10_names_count)
 		return post_format10_names[glyph];
-	}
-	else
-	{
-		return ".notdef";
-	}
+	return ".notdef";
 }
 
 




More information about the scribus-commit mailing list