r22517 by craig - More nullptr and other conversions

scribus-commit scribus-commit at lists.scribus.net
Wed May 2 20:08:53 UTC 2018


Author: craig
Date: Wed May  2 20:08:52 2018
New Revision: 22517

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22517
Log:
More nullptr and other conversions

Modified:
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h
    trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/mark2item.cpp
    trunk/Scribus/scribus/ui/mark2item.h
    trunk/Scribus/scribus/ui/mark2mark.cpp
    trunk/Scribus/scribus/ui/mark2mark.h
    trunk/Scribus/scribus/ui/markanchor.h
    trunk/Scribus/scribus/ui/marknote.h
    trunk/Scribus/scribus/ui/marksmanager.cpp
    trunk/Scribus/scribus/ui/marksmanager.h
    trunk/Scribus/scribus/ui/nftwidget.cpp
    trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
    trunk/Scribus/scribus/ui/printdialog.cpp
    trunk/Scribus/scribus/ui/scmenu.cpp
    trunk/Scribus/scribus/ui/swatchcombo.h

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode.cpp	Wed May  2 20:08:52 2018
@@ -79,7 +79,7 @@
 	m_view(view),
 	m_canvas(view->m_canvas),
 	m_doc(view->Doc),
-	m_panGesture(NULL),
+	m_panGesture(nullptr),
 	undoManager(UndoManager::instance()),
 	xSnap(0.0),
 	ySnap(0.0)
@@ -1059,7 +1059,7 @@
 	QList<QMdiSubWindow *> windows;
 	
 	QMdiArea* mdiArea = mainWindow->mdiArea;
-	QMdiSubWindow* w  = NULL;
+	QMdiSubWindow* w  = nullptr;
 	PrefsManager*   prefsManager      = PrefsManager::instance();
 	OutlinePalette* outlinePalette    = mainWindow->outlinePalette;
 	CheckDocument*  docCheckerPalette = mainWindow->docCheckerPalette;
@@ -1097,7 +1097,7 @@
 		m_doc->leaveDrag = false;
 		m_view->stopAllDrags();
 		m_doc->SubMode = -1;
-		m_doc->ElemToLink = NULL;
+		m_doc->ElemToLink = nullptr;
 		mainWindow->slotSelect();
 		if (m_doc->m_Selection->count() == 0)
 			mainWindow->HaveNewSel();
@@ -1115,7 +1115,7 @@
 		//Show our context menu
 		if (m_view->m_ScMW->actionManager->compareKeySeqToShortcut(kk, e->modifiers(), "viewShowContextMenu"))
 		{
-			ContextMenu* cmen=NULL;
+			ContextMenu* cmen=nullptr;
 			m_view->setCursor(QCursor(Qt::ArrowCursor));
 			if (m_doc->m_Selection->count() == 0)
 			{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp	Wed May  2 20:08:52 2018
@@ -177,7 +177,7 @@
 		fileDir = canonicalPath;
 
 	// Create a random temporary file name
-	srand(time(NULL)); // initialize random sequence each time
+	srand(time(nullptr)); // initialize random sequence each time
 	long randt = 0;
 	long randn = 1 + (int) (((double) rand() / ((double) RAND_MAX + 1)) * 10000);
 	QString  tmpFileName  = QString("%1.%2").arg(fileName).arg(randn);
@@ -1322,7 +1322,7 @@
 		if (mrk->isType(MARK2ItemType) && mrk->hasItemPtr())
 		{
 			const PageItem* item = mrk->getItemPtr();
-			assert(item != NULL);
+			assert(item != nullptr);
 			docu.writeAttribute("ItemID", qHash(item) & 0x7FFFFFFF);
 			//docu.writeAttribute("itemName", item->itemName());
 		}
@@ -1457,7 +1457,7 @@
 	for (itTN = m_Doc->notesList().begin(); itTN != end; ++itTN)
 	{
 		TextNote* TN = (*itTN);
-		if (TN->masterMark() == NULL)
+		if (TN->masterMark() == nullptr)
 			continue;
 		docu.writeEmptyElement("Note");
 		docu.writeAttribute("Master", TN->masterMark()->label);
@@ -1667,7 +1667,7 @@
 			lastPos = k;
 		}
 
-		if (ch == SpecialChars::OBJECT && item->itemText.object(k).getPageItem(doc) != NULL) 
+		if (ch == SpecialChars::OBJECT && item->itemText.object(k).getPageItem(doc) != nullptr)
 		{
 			// each obj in its own ITEXT for now
 			docu.writeEmptyElement("ITEXT");
@@ -1764,9 +1764,9 @@
 void Scribus150Format::WriteObjects(ScribusDoc *doc, ScXmlStreamWriter& docu, const QString& baseDir, QProgressBar *dia2, uint maxC, ItemSelection master, QList<PageItem*> *some_items)
 {
 	uint ObCount = maxC;
-	QList<PageItem*> *items = NULL;
+	QList<PageItem*> *items = nullptr;
 	QList<PageItem*> itemList;
-	PageItem *item = NULL;
+	PageItem *item = nullptr;
 	uint objects = 0;
 	switch (master)
 	{
@@ -1777,7 +1777,7 @@
 			items = &doc->DocItems;
 			break;
 		case ItemSelectionFrame:
-			if (some_items != NULL)
+			if (some_items != nullptr)
 				items = some_items;
 			else
 			{
@@ -2034,7 +2034,7 @@
 			{
 				PageItem::WeldingInfo wInf = item->weldList.at(i);
 				PageItem *pIt = wInf.weldItem;
-				if (pIt == NULL)
+				if (pIt == nullptr)
 				{
 					qDebug() << "Saving welding info - empty pointer!!!";
 					continue;
@@ -2519,7 +2519,7 @@
 		{
 			PageItem::WeldingInfo wInf = item->weldList.at(i);
 			PageItem *pIt = wInf.weldItem;
-			if (pIt != NULL && !pIt->isAutoNoteFrame())
+			if (pIt != nullptr && !pIt->isAutoNoteFrame())
 			{
 				isWelded = true;
 				break;

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	Wed May  2 20:08:52 2018
@@ -235,7 +235,7 @@
 	tmpSel=new Selection(this, false);
 }
 
-QImage OODPlug::readThumbnail(QString fileName )
+QImage OODPlug::readThumbnail(const QString& fileName )
 {
 	QByteArray f, f2, f3;
 	if ( !QFile::exists(fileName) )

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h	(original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h	Wed May  2 20:08:52 2018
@@ -99,7 +99,7 @@
 	bool importFailed;
 	bool importCanceled;
 	bool import(QString fName, const TransactionSettings& trSettings, int flags);
-	QImage readThumbnail(QString fileName );
+	QImage readThumbnail(const QString& fileName );
 	static double parseUnit(const QString &unit);
 
 protected:

Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp	Wed May  2 20:08:52 2018
@@ -194,7 +194,7 @@
 	if (scripterCore)
 	{
 		delete scripterCore;
-		scripterCore = NULL;
+		scripterCore = nullptr;
 	}
 	Py_Finalize();
 	return true;
@@ -241,9 +241,9 @@
 
 /*static */PyObject *scribus_retval(PyObject* /*self*/, PyObject* args)
 {
-	char *Name = NULL;
+	char *Name = nullptr;
 	if (!PyArg_ParseTuple(args, (char*)"s", &Name))
-		return NULL;
+		return nullptr;
 	// Because sysdefaultencoding is not utf-8, Python is returning utf-8 encoded
 	// 8-bit char* strings. Make sure Qt understands that the input is utf-8 not
 	// the default local encoding (usually latin-1) by using QString::fromUtf8()
@@ -591,7 +591,7 @@
 	{const_cast<char*>("setTextAnnotation"), scribus_settextannotation, METH_VARARGS,tr(scribus_settextannotation__doc__)},
 	{const_cast<char*>("createPdfAnnotation"), scribus_createpdfannotation, METH_VARARGS,tr(scribus_createpdfannotation__doc__)},
 	{const_cast<char*>("isAnnotated"),(PyCFunction)scribus_isannotated, METH_VARARGS|METH_KEYWORDS,tr(scribus_isannotated__doc__)},
-	{NULL, (PyCFunction)(0), 0, NULL} /* sentinel */
+	{nullptr, (PyCFunction)(0), 0, nullptr} /* sentinel */
 };
 
 void initscribus_failed(const char* fileName, int lineNo)
@@ -626,27 +626,27 @@
 
 	// Set up the module exceptions
 	// common exc.
-	ScribusException = PyErr_NewException((char*)"scribus.ScribusException", NULL, NULL);
+	ScribusException = PyErr_NewException((char*)"scribus.ScribusException", nullptr, nullptr);
 	Py_INCREF(ScribusException);
 	PyModule_AddObject(m, (char*)"ScribusException", ScribusException);
 	// no doc open
-	NoDocOpenError = PyErr_NewException((char*)"scribus.NoDocOpenError", ScribusException, NULL);
+	NoDocOpenError = PyErr_NewException((char*)"scribus.NoDocOpenError", ScribusException, nullptr);
 	Py_INCREF(NoDocOpenError);
 	PyModule_AddObject(m, (char*)"NoDocOpenError", NoDocOpenError);
 	// wrong type of frame for operation
-	WrongFrameTypeError = PyErr_NewException((char*)"scribus.WrongFrameTypeError", ScribusException, NULL);
+	WrongFrameTypeError = PyErr_NewException((char*)"scribus.WrongFrameTypeError", ScribusException, nullptr);
 	Py_INCREF(WrongFrameTypeError);
 	PyModule_AddObject(m, (char*)"WrongFrameTypeError", WrongFrameTypeError);
 	// Couldn't find named object, or no named object and no selection
-	NoValidObjectError = PyErr_NewException((char*)"scribus.NoValidObjectError", ScribusException, NULL);
+	NoValidObjectError = PyErr_NewException((char*)"scribus.NoValidObjectError", ScribusException, nullptr);
 	Py_INCREF(NoValidObjectError);
 	PyModule_AddObject(m, (char*)"NoValidObjectError", NoValidObjectError);
 	// Couldn't find the specified resource - font, color, etc.
-	NotFoundError = PyErr_NewException((char*)"scribus.NotFoundError", ScribusException, NULL);
+	NotFoundError = PyErr_NewException((char*)"scribus.NotFoundError", ScribusException, nullptr);
 	Py_INCREF(NotFoundError);
 	PyModule_AddObject(m, (char*)"NotFoundError", NotFoundError);
 	// Tried to create an object with the same name as one that already exists
-	NameExistsError = PyErr_NewException((char*)"scribus.NameExistsError", ScribusException, NULL);
+	NameExistsError = PyErr_NewException((char*)"scribus.NameExistsError", ScribusException, nullptr);
 	Py_INCREF(NameExistsError);
 	PyModule_AddObject(m, (char*)"NameExistsError", NameExistsError);
 	// Done with exception setup
@@ -824,7 +824,7 @@
 		QString extraVersion = version_re.cap(4);
 		PyObject* versionTuple = Py_BuildValue(const_cast<char*>("(iiisi)"),\
 				majorVersion, minorVersion, patchVersion, (const char*)extraVersion.toUtf8(), 0);
-		if (versionTuple != NULL)
+		if (versionTuple != nullptr)
 			PyDict_SetItemString(d, const_cast<char*>("scribus_version_info"), versionTuple);
 		else
 			qDebug("Failed to build version tuple for version string '%s' in scripter", VERSION);
@@ -840,7 +840,7 @@
 	// from C in other ways too.
 	PyObject* builtinModule = PyImport_ImportModuleEx(const_cast<char*>("__builtin__"),
 			d, d, Py_BuildValue(const_cast<char*>("[]")));
-	if (builtinModule == NULL)
+	if (builtinModule == nullptr)
 	{
 		qDebug("Failed to import __builtin__ module. Something is probably broken with your Python.");
 		return;
@@ -848,7 +848,7 @@
 	PyDict_SetItemString(d, const_cast<char*>("__builtin__"), builtinModule);
 	PyObject* exceptionsModule = PyImport_ImportModuleEx(const_cast<char*>("exceptions"),
 			d, d, Py_BuildValue(const_cast<char*>("[]")));
-	if (exceptionsModule == NULL)
+	if (exceptionsModule == nullptr)
 	{
 		qDebug("Failed to import exceptions module. Something is probably broken with your Python.");
 		return;
@@ -856,7 +856,7 @@
 	PyDict_SetItemString(d, const_cast<char*>("exceptions"), exceptionsModule);
 	PyObject* warningsModule = PyImport_ImportModuleEx(const_cast<char*>("warnings"),
 			d, d, Py_BuildValue(const_cast<char*>("[]")));
-	if (warningsModule == NULL)
+	if (warningsModule == nullptr)
 	{
 		qDebug("Failed to import warnings module. Something is probably broken with your Python.");
 		return;
@@ -902,15 +902,15 @@
 		qDebug("Failed to create module-level docstring (couldn't make str)");
 	else
 	{
-		PyObject* uniDocStr = PyUnicode_FromEncodedObject(docStr, "utf-8", NULL);
+		PyObject* uniDocStr = PyUnicode_FromEncodedObject(docStr, "utf-8", nullptr);
 		Py_DECREF(docStr);
-		docStr = NULL;
+		docStr = nullptr;
 		if (!uniDocStr)
 			qDebug("Failed to create module-level docstring object (couldn't make unicode)");
 		else
 			PyDict_SetItemString(d, const_cast<char*>("__doc__"), uniDocStr);
 		Py_DECREF(uniDocStr);
-		uniDocStr = NULL;
+		uniDocStr = nullptr;
 	}
 
 	// Wrap up pointers to the the QApp and main window and push them out
@@ -924,7 +924,7 @@
 	// Push it into the module dict, stealing a ref in the process
 	PyDict_SetItemString(d, const_cast<char*>("qApp"), wrappedQApp);
 	Py_DECREF(wrappedQApp);
-	wrappedQApp = NULL;
+	wrappedQApp = nullptr;
 
 	wrappedMainWindow = wrapQObject(pl);
 	if (!wrappedMainWindow)
@@ -935,7 +935,7 @@
 	// Push it into the module dict, stealing a ref in the process
 	PyDict_SetItemString(d, const_cast<char*>("mainWindow"), wrappedMainWindow);
 	Py_DECREF(wrappedMainWindow);
-	wrappedMainWindow = NULL;
+	wrappedMainWindow = nullptr;
 }
 
 /*! HACK: this removes "warning: 'blah' defined but not used" compiler warnings

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp	Wed May  2 20:08:52 2018
@@ -70,9 +70,9 @@
 {
 	undoManager = UndoManager::instance();
 	m_blockUpdates = 0;
-	currentItem = NULL;
-	patternList = NULL;
-	CGradDia = NULL;
+	currentItem = nullptr;
+	patternList = nullptr;
+	CGradDia = nullptr;
 	CGradDia = new GradientVectorDialog(this->parentWidget());
 	CGradDia->hide();
 
@@ -249,7 +249,7 @@
 
 void Cpalette::setCurrentItem(PageItem* item)
 {
-	if ((item == NULL) || (currentItem != item))
+	if ((item == nullptr) || (currentItem != item))
 	{
 		editStrokeGradient = 0;
 		CGradDia->hide();
@@ -374,10 +374,10 @@
 	ScribusDoc* oldDoc = currentDoc;
 	currentDoc = doc;
 
-	if (doc == NULL)
-	{
-		colorListStroke->cList = NULL;
-		colorListFill->cList = NULL;
+	if (doc == nullptr)
+	{
+		colorListStroke->cList = nullptr;
+		colorListFill->cList = nullptr;
 		disconnectSignals();
 	}
 	else
@@ -417,7 +417,7 @@
 
 PageItem* Cpalette::currentItemFromSelection()
 {
-	PageItem *currentItem = NULL;
+	PageItem *currentItem = nullptr;
 	if (currentDoc)
 		currentItem = currentDoc->m_Selection->itemAt(0);
 	return currentItem;
@@ -479,7 +479,7 @@
 
 	if (displayAllColors->isChecked())
 	{
-		if (currentDoc != NULL)
+		if (currentDoc != nullptr)
 			currentDoc->getUsedColors(colorList);
 	}
 	colorListFill->setColors(colorList, true);
@@ -502,7 +502,7 @@
 
 void Cpalette::toggleColorDisplay()
 {
-	if (currentDoc != NULL)
+	if (currentDoc != nullptr)
 	{
 		colorListStroke->cList = &currentDoc->PageColors;
 		colorListFill->cList = &currentDoc->PageColors;
@@ -882,14 +882,14 @@
 
 void Cpalette::selectPattern(QListWidgetItem *c)
 {
-	if (c == NULL)
+	if (c == nullptr)
 		return;
 	emit NewPattern(c->text());
 }
 
 void Cpalette::selectPatternS(QListWidgetItem *c)
 {
-	if (c == NULL)
+	if (c == nullptr)
 		return;
 	emit NewPatternS(c->text());
 }
@@ -1373,7 +1373,7 @@
 	{
 		if ((grow == -1) || (gcol == 0))
 			return;
-		ScItemState<QPair<MeshPoint,MeshPoint> > *ss = NULL;
+		ScItemState<QPair<MeshPoint,MeshPoint> > *ss = nullptr;
 		if(UndoManager::undoEnabled())
 		{
 			ss = new ScItemState<QPair<MeshPoint,MeshPoint> >(Um::GradPos);
@@ -1468,7 +1468,7 @@
 	{
 		if ((grow == -1) || (gcol == 0))
 			return;
-		ScItemState<QPair<MeshPoint,MeshPoint> > *ss = NULL;
+		ScItemState<QPair<MeshPoint,MeshPoint> > *ss = nullptr;
 		if(UndoManager::undoEnabled())
 		{
 			ss = new ScItemState<QPair<MeshPoint,MeshPoint> >(Um::GradPos);

Modified: trunk/Scribus/scribus/ui/mark2item.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/mark2item.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/mark2item.cpp	(original)
+++ trunk/Scribus/scribus/ui/mark2item.cpp	Wed May  2 20:08:52 2018
@@ -32,7 +32,7 @@
 
 void Mark2Item::setValues(const QString label, const PageItem* ptr)
 {
-	int index = (ptr == NULL)? -1:ItemList->findText(ptr->itemName());
+	int index = (ptr == nullptr) ? -1 : ItemList->findText(ptr->itemName());
 	ItemList->setCurrentIndex(index);
 	labelEdit->setText(label);
 }

Modified: trunk/Scribus/scribus/ui/mark2item.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/mark2item.h
==============================================================================
--- trunk/Scribus/scribus/ui/mark2item.h	(original)
+++ trunk/Scribus/scribus/ui/mark2item.h	Wed May  2 20:08:52 2018
@@ -9,7 +9,7 @@
     Q_OBJECT
 
 public:
-	explicit Mark2Item(QWidget *parent = 0);
+	explicit Mark2Item(QWidget *parent = nullptr);
 	virtual void values(QString &label, PageItem* &ptr);
 	virtual void setValues(const QString label, const PageItem* ptr);
 

Modified: trunk/Scribus/scribus/ui/mark2mark.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/mark2mark.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/mark2mark.cpp	(original)
+++ trunk/Scribus/scribus/ui/mark2mark.cpp	Wed May  2 20:08:52 2018
@@ -5,7 +5,7 @@
 Mark2Mark::Mark2Mark(const QList<Mark*>& marks, Mark* omitMark, QWidget *parent) : MarkInsert(marks, parent)
 {
 	setupUi(this);
-	LabelList->addItem("", QVariant::fromValue((void*) NULL));
+	LabelList->addItem("", QVariant::fromValue((void*) nullptr));
 	
 	//for each marks type
 	QString typeStr;
@@ -76,14 +76,14 @@
 	label = this->labelEdit->text();
 	int labelID = LabelList->currentIndex();
 	if (labelID == 0)
-		mrk= NULL;
+		mrk= nullptr;
 	else
 		mrk = (Mark*) LabelList->itemData(labelID).value<void*>();
 }
 
 void Mark2Mark::setValues(const QString label, const Mark* mrk)
 {
-	int index = (mrk == NULL)? -1:LabelList->findText(mrk->label);
+	int index = (mrk == nullptr)? -1:LabelList->findText(mrk->label);
 	LabelList->setCurrentIndex(index);
 	labelEdit->setText(label);
 }

Modified: trunk/Scribus/scribus/ui/mark2mark.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/mark2mark.h
==============================================================================
--- trunk/Scribus/scribus/ui/mark2mark.h	(original)
+++ trunk/Scribus/scribus/ui/mark2mark.h	Wed May  2 20:08:52 2018
@@ -9,7 +9,7 @@
     Q_OBJECT
 
 public:
-	explicit Mark2Mark(const QList<Mark*>& marks, Mark* omitMark = NULL, QWidget *parent = NULL);
+	explicit Mark2Mark(const QList<Mark*>& marks, Mark* omitMark = nullptr, QWidget *parent = nullptr);
 	virtual void values(QString& label, Mark* &mrk);
 	virtual void setValues(const QString label, const Mark* mrk);
 

Modified: trunk/Scribus/scribus/ui/markanchor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/markanchor.h
==============================================================================
--- trunk/Scribus/scribus/ui/markanchor.h	(original)
+++ trunk/Scribus/scribus/ui/markanchor.h	Wed May  2 20:08:52 2018
@@ -9,7 +9,7 @@
     Q_OBJECT
 
 public:
-	explicit MarkAnchor(QWidget *parent = 0);
+	explicit MarkAnchor(QWidget *parent = nullptr);
 	~MarkAnchor() {}
 	virtual void values(QString& label);
 	virtual void setValues(const QString label);

Modified: trunk/Scribus/scribus/ui/marknote.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/marknote.h
==============================================================================
--- trunk/Scribus/scribus/ui/marknote.h	(original)
+++ trunk/Scribus/scribus/ui/marknote.h	Wed May  2 20:08:52 2018
@@ -10,7 +10,7 @@
 	Q_OBJECT
 	
 public:
-	explicit MarkNote(const QList<NotesStyle*>& notesStylesList, QWidget *parent = NULL);
+	explicit MarkNote(const QList<NotesStyle*>& notesStylesList, QWidget *parent = nullptr);
 	virtual NotesStyle* values();
 	virtual void setValues(const NotesStyle* defaultStyle);
 

Modified: trunk/Scribus/scribus/ui/marksmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/marksmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/marksmanager.cpp	(original)
+++ trunk/Scribus/scribus/ui/marksmanager.cpp	Wed May  2 20:08:52 2018
@@ -9,7 +9,7 @@
 #include <QStandardItemModel>
 
 MarksManager::MarksManager(QWidget *parent, const char *name)
-	: ScrPaletteBase(parent, name), m_Doc(NULL)
+	: ScrPaletteBase(parent, name), m_Doc(nullptr)
 {
 	setupUi(this);
 	listView->setSelectionMode(QAbstractItemView::SingleSelection);
@@ -90,7 +90,7 @@
 {
 	storeColaption();
 	listView->clear();
-	if (m_Doc == NULL)
+	if (m_Doc == nullptr)
 		return;
 	if (m_Doc->marksList().isEmpty())
 		UpdateButton->setEnabled(false);
@@ -113,7 +113,7 @@
 
 void MarksManager::setDoc(ScribusDoc *doc)
 {
-	if (m_Doc != NULL)
+	if (m_Doc != nullptr)
 		disconnect(m_Doc->scMW(), SIGNAL(UpdateRequest(int)), this , SLOT(handleUpdateRequest(int)));
 
 	UpdateButton->setEnabled(false);
@@ -149,7 +149,7 @@
 	listView->setToolTip(tr("Double click to find mark in text"));
 	UpdateButton->setToolTip(tr("Update all reference texts for all marks"));
 	EditButton->setToolTip(tr("Edit selected mark"));
-	if (m_Doc != NULL)
+	if (m_Doc != nullptr)
 		updateListView();
 }
 
@@ -164,8 +164,8 @@
 Mark* MarksManager::getMarkFromListView()
 {
 	QTreeWidgetItem* selectedItem = listView->currentItem();
-	if (selectedItem == NULL)
-		return NULL;
+	if (selectedItem == nullptr)
+		return nullptr;
 	Mark* mrk = reinterpret_cast<Mark*>(selectedItem->data(1, Qt::UserRole).value<void*>());
 	return mrk;
 }
@@ -207,7 +207,7 @@
 void MarksManager::on_EditButton_clicked()
 {
 	Mark* mrk = getMarkFromListView();
-	if (mrk == NULL)
+	if (mrk == nullptr)
 		return;
 
 	if (m_Doc->scMW()->editMarkDlg(mrk))
@@ -225,14 +225,14 @@
 void MarksManager::on_DeleteButton_clicked()
 {
 	Mark* mrk = getMarkFromListView();
-	if (mrk == NULL)
+	if (mrk == nullptr)
 		return;
 
 	if (mrk->isType(MARKNoteMasterType))
 		m_Doc->setUndoDelNote(mrk->getNotePtr());
 	else
 		m_Doc->setUndoDelMark(mrk);
-	m_Doc->eraseMark(mrk, true, NULL, true);
+	m_Doc->eraseMark(mrk, true, nullptr, true);
 	m_Doc->changed();
 	m_Doc->regionsChanged()->update(QRectF());
 	updateListView();
@@ -241,13 +241,13 @@
 void MarksManager::on_listView_doubleClicked(const QModelIndex &index)
 {
 	Mark* mrk = getMarkFromListView();
-	if (mrk != NULL)
+	if (mrk != nullptr)
 		m_Doc->setCursor2MarkPos(mrk);
 }
 
 void MarksManager::on_listView_itemSelectionChanged()
 {
-	bool isMark = (getMarkFromListView() != NULL);
+	bool isMark = (getMarkFromListView() != nullptr);
 	EditButton->setEnabled(isMark);
 	DeleteButton->setEnabled(isMark);
 }

Modified: trunk/Scribus/scribus/ui/marksmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/marksmanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/marksmanager.h	(original)
+++ trunk/Scribus/scribus/ui/marksmanager.h	Wed May  2 20:08:52 2018
@@ -14,7 +14,7 @@
 	Q_OBJECT
 
 public:
-	explicit MarksManager(QWidget *parent = 0, const char *name = "MarksManager");
+	explicit MarksManager(QWidget *parent = nullptr, const char *name = "MarksManager");
 	~MarksManager();
 
 	virtual void changeEvent(QEvent *e);

Modified: trunk/Scribus/scribus/ui/nftwidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/nftwidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/nftwidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/nftwidget.cpp	Wed May  2 20:08:52 2018
@@ -20,9 +20,9 @@
 nftwidget::nftwidget(QWidget* parent) : QWidget(parent)
 {
 	setupUi(this);
-	currentDocumentTemplate = NULL;
-	settings = NULL;
-	openAction = removeAction = NULL;
+	currentDocumentTemplate = nullptr;
+	settings = nullptr;
+	openAction = removeAction = nullptr;
 }
 
 void nftwidget::setupSettings(QString lang)
@@ -73,7 +73,7 @@
 	{
 		if (!settings->templates[i]->isDeleted)
 		{
-			ListItem* tmp = new ListItem(settings->templates[i], (QListWidgetItem*) NULL);
+			ListItem* tmp = new ListItem(settings->templates[i], (QListWidgetItem*) nullptr);
 			iconItems.push_back(tmp);
 		}
 	}
@@ -127,7 +127,7 @@
 				iconItems[i]->second = tmpQIVI;
 			} 
 			else
-				iconItems[i]->second = NULL;
+				iconItems[i]->second = nullptr;
 		}
 		tnailGrid->sortItems();
 	}
@@ -204,7 +204,7 @@
 	currentDocumentTemplate->isDeleted = true;
 	textBrowser->clear();
 	imageView->clear();
-	currentDocumentTemplate = NULL;
+	currentDocumentTemplate = nullptr;
 	emit ButtonBoxEnable(false);
 	setupListItems();
 	setupCategories();
@@ -229,7 +229,7 @@
 	delete settings;
 	for (uint i = 0; i < iconItems.size(); i++)
 	{
-		if (iconItems[i] != NULL)
+		if (iconItems[i] != nullptr)
 			delete iconItems[i];
 	}
 }

Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp	Wed May  2 20:08:52 2018
@@ -39,8 +39,8 @@
 	QVector< QPair<QString, QStringList> >::Iterator itnmenua = defNonMenuActions->begin();
 	PluginManager& pluginManager(PluginManager::instance());
 	QStringList pluginNames(pluginManager.pluginNames(false));
-	ScPlugin* plugin = NULL;
-	ScActionPlugin* ixplug = NULL;
+	ScPlugin* plugin = nullptr;
+	ScActionPlugin* ixplug = nullptr;
 	QString pName;
 	for (int i = 0; i < pluginNames.count(); ++i)
 	{
@@ -64,7 +64,7 @@
 	keyCode = 0;
 	keyDisplay->setMinimumWidth(fontMetrics().width("CTRL+ALT+SHIFT+W"));
 	keyDisplay->setText("");
-	selectedLVI = NULL;
+	selectedLVI = nullptr;
 
 	clearSearchButton->setIcon(IconManager::instance()->loadIcon("clear_right.png"));
 	// signals and slots connections
@@ -317,10 +317,10 @@
 	lviToMenuMap.clear();
 	keyTable->clear();
 	bool first, firstMenu=true;
-	QTreeWidgetItem *currLVI = NULL;
-	QTreeWidgetItem *currMenuLVI = NULL;
-	QTreeWidgetItem *prevLVI = NULL;
-	QTreeWidgetItem *prevMenuLVI = NULL;
+	QTreeWidgetItem *currLVI = nullptr;
+	QTreeWidgetItem *currMenuLVI = nullptr;
+	QTreeWidgetItem *prevLVI = nullptr;
+	QTreeWidgetItem *prevMenuLVI = nullptr;
 	for (int i = 0; i < defMenus->count(); ++i)
 	{
 		const QPair<QString, QStringList> &actionStrings = defMenus->at(i);

Modified: trunk/Scribus/scribus/ui/printdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/printdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/printdialog.cpp	(original)
+++ trunk/Scribus/scribus/ui/printdialog.cpp	Wed May  2 20:08:52 2018
@@ -179,12 +179,12 @@
 
 #elif defined(_WIN32)
 	bool done;
-	Qt::HANDLE handle = NULL;
+	Qt::HANDLE handle = nullptr;
 	DEVMODEW* devMode = (DEVMODEW*) DevMode.data();
 	// Retrieve the selected printer
 	QString printerS = PrintDest->currentText(); 
 	// Get a printer handle
-	done = OpenPrinterW((LPWSTR) printerS.utf16(), &handle, NULL);
+	done = OpenPrinterW((LPWSTR) printerS.utf16(), &handle, nullptr);
 	if (!done)
 		return;
 	// Merge stored settings, prompt user and return user settings

Modified: trunk/Scribus/scribus/ui/scmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/scmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scmenu.cpp	(original)
+++ trunk/Scribus/scribus/ui/scmenu.cpp	Wed May  2 20:08:52 2018
@@ -152,7 +152,7 @@
 			if (menuItemListClassName == "ScrAction")
 			{
 				ScrAction * act = dynamic_cast<ScrAction *>(menuItem);
-				if (act!=NULL)
+				if (act!=nullptr)
 					menuListHasNoIcons = act->icon().isNull();
 				break;
 			}
@@ -160,7 +160,7 @@
 			else if (menuItemListClassName == "ScrPopupMenu")
 			{
 				ScrPopupMenu * men = dynamic_cast<ScrPopupMenu *>(menuItem);
-				if (men!=NULL)
+				if (men!=nullptr)
 					menuListHasNoIcons = men->getMenuIcon().isNull();
 				break;
 			}
@@ -182,7 +182,7 @@
 {
 	if (widget)
 	{
-		ScrAction *widgetAction = new ScrAction( NULL, "widget_action" );
+		ScrAction *widgetAction = new ScrAction( nullptr, "widget_action" );
 		menuItemList.append(widgetAction);
 		localPopupMenu->insertItem(widget);
 		return true;
@@ -278,7 +278,7 @@
 	while (menuItemListIt!=menuItemList.end())
 	{
 		QObject *listObj=(*menuItemListIt);
-		if (listObj==NULL)
+		if (listObj==nullptr)
 		{
 			QList< QPointer<QObject> >::Iterator menuItemListItToDelete = menuItemListIt;
 			++menuItemListIt;
@@ -290,7 +290,7 @@
 		if (menuItemListClassName=="ScrAction")
 		{
 			ScrAction * act = dynamic_cast<ScrAction *>(listObj);
-			if (act!=NULL)
+			if (act!=nullptr)
 				localPopupMenu->addAction(act);
 		}
 		else 
@@ -298,7 +298,7 @@
 			if (menuItemListClassName=="ScrPopupMenu")
 			{
 				ScrPopupMenu * men = dynamic_cast<ScrPopupMenu *>(listObj);
-				if (men!=NULL)
+				if (men!=nullptr)
 				{
 					//qDebug()<<men->localPopupMenu->title()<<men->localPopupMenu->;
 // 					localPopupMenu->insertItem(men->getMenuIcon(), men->getMenuText(), men->getLocalPopupMenu());
@@ -321,7 +321,7 @@
 	while (menuItemListIt!=menuItemList.end())
 	{
 		QObject *listObj=(*menuItemListIt);
-		if (listObj==NULL)
+		if (listObj==nullptr)
 		{
 			QList< QPointer<QObject> >::Iterator menuItemListItToDelete = menuItemListIt;
 			++menuItemListIt;
@@ -333,14 +333,14 @@
 		if (menuItemListClassName=="ScrAction")
 		{
 			ScrAction *sca=dynamic_cast<ScrAction *>(listObj);
-			if (sca!=NULL)
+			if (sca!=nullptr)
 				actNames->append(sca->objectName());
 		}
 		else 
 		if (menuItemListClassName=="ScrPopupMenu")
 		{
 			ScrPopupMenu *scp=dynamic_cast<ScrPopupMenu *>(listObj);
-			if (scp!=NULL)
+			if (scp!=nullptr)
 				scp->generateEntryList(actNames);
 		}
 		++menuItemListIt;
@@ -358,7 +358,7 @@
 
 bool ScrPopupMenu::insertMenuSeparator()
 {
-	ScrAction *sepAction = new ScrAction( NULL );
+	ScrAction *sepAction = new ScrAction( nullptr );
 	sepAction->setSeparator(true);
 	menuItemList.append(sepAction);
 	localPopupMenu->addSeparator();

Modified: trunk/Scribus/scribus/ui/swatchcombo.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22517&path=/trunk/Scribus/scribus/ui/swatchcombo.h
==============================================================================
--- trunk/Scribus/scribus/ui/swatchcombo.h	(original)
+++ trunk/Scribus/scribus/ui/swatchcombo.h	Wed May  2 20:08:52 2018
@@ -38,7 +38,7 @@
 	Q_OBJECT
 
 public:
-	SwatchCombo( QWidget* parent = NULL );
+	SwatchCombo( QWidget* parent = nullptr );
 	QTreeWidgetItem* addTopLevelItem(QString name);
 	QTreeWidgetItem* addSubItem(QString name, QTreeWidgetItem* parent, bool selectable = true);
 	void setCurrentComboItem(QString text);




More information about the scribus-commit mailing list