r24172 by craig - Code cleanup

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 4 00:40:28 UTC 2020


Author: craig
Date: Wed Nov  4 00:40:27 2020
New Revision: 24172

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24172
Log:
Code cleanup

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/ui/vruler.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24172&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp	(original)
+++ trunk/Scribus/scribus/canvas.cpp	Wed Nov  4 00:40:27 2020
@@ -461,7 +461,7 @@
 		}
 	}
 	// now look for normal items
-	if (m_doc->Items->count() == 0)
+	if (m_doc->Items->isEmpty())
 		return nullptr;
 
 	QList<PageItem*> *itemList = (itemAbove && itemAbove->isGroupChild()) ? &itemAbove->parentGroup()->groupItemList : m_doc->Items;

Modified: trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24172&path=/trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scriptplugin_py2x/cmdpage.cpp	Wed Nov  4 00:40:27 2020
@@ -237,7 +237,7 @@
 		return nullptr;
 	ScribusDoc* currentDoc = ScCore->primaryMainWindow()->doc;
 
-	if (currentDoc->Items->count() == 0)
+	if (currentDoc->Items->isEmpty())
 		return Py_BuildValue((char*)"[]");
 	uint counter = 0;
 	int pageNr = currentDoc->currentPageNumber();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24172&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Wed Nov  4 00:40:27 2020
@@ -6476,7 +6476,7 @@
 	else
 	{
 		ScPage* addedPage = TempPages.at(0);
-		if (Items->count() == 0)
+		if (Items->isEmpty())
 		{
 			removePattern(m_currentEditedSymbol);
 		}
@@ -6620,7 +6620,7 @@
 	else
 	{
 		ScPage* addedPage = TempPages.at(0);
-		if (Items->count() == 0)
+		if (Items->isEmpty())
 		{
 			removeInlineFrame(m_currentEditedIFrame);
 		}

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24172&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Wed Nov  4 00:40:27 2020
@@ -1309,7 +1309,7 @@
 	FPoint maxCanvasCoordinate;
 	double rulerXoffset {0.0};
 	double rulerYoffset {0.0};
-	//! Page is a pointer to the lists of pages that exist in a document. In Normal mode, it points to DocPages. In Master Page mode it points to MasterPages. See ScribusDoc::assignPageModeLists()
+	//! Pages is a pointer to the lists of pages that exist in a document. In Normal mode, it points to DocPages. In Master Page mode it points to MasterPages. See ScribusDoc::assignPageModeLists()
 	QList<ScPage*>* Pages {nullptr};
 	/** \brief List of Master Pages */
 	QList<ScPage*> MasterPages;

Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24172&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp	(original)
+++ trunk/Scribus/scribus/ui/vruler.cpp	Wed Nov  4 00:40:27 2020
@@ -123,7 +123,7 @@
 					tx = QString::number(static_cast<int>(xl));
 					double frac = fabs(xl - static_cast<int>(xl));
 					if ((static_cast<int>(xl) == 0) && (frac > 0.1))
-						tx = "";
+						tx.clear();
 					if ((frac > 0.24) && (frac < 0.26))
 						tx += QChar(0xBC);
 					if ((frac > 0.49) && (frac < 0.51))




More information about the scribus-commit mailing list