r23821 by jghali - Mostly cosmetic changes

scribus-commit scribus-commit at lists.scribus.net
Tue May 19 22:51:42 UTC 2020


Author: jghali
Date: Tue May 19 22:51:42 2020
New Revision: 23821

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23821
Log:
Mostly cosmetic changes

Modified:
    trunk/Scribus/scribus/chartableview.cpp
    trunk/Scribus/scribus/pdfversion.cpp
    trunk/Scribus/scribus/text/specialchars.cpp
    trunk/Scribus/scribus/text/storytext.cpp
    trunk/Scribus/scribus/ui/pagepalette_pages.cpp
    trunk/Scribus/scribus/ui/resourcemanager.cpp
    trunk/Scribus/scribus/units.cpp
    trunk/Scribus/scribus/units.h
    trunk/Scribus/scribus/util_color.cpp
    trunk/Scribus/scribus/vgradientex.cpp
    trunk/Scribus/scribus/vgradientex.h

Modified: trunk/Scribus/scribus/chartableview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/chartableview.cpp
==============================================================================
--- trunk/Scribus/scribus/chartableview.cpp	(original)
+++ trunk/Scribus/scribus/chartableview.cpp	Tue May 19 22:51:42 2020
@@ -20,7 +20,7 @@
 {
 	deleteAct = new QAction( tr("Delete"), this);
 	connect(deleteAct, SIGNAL(triggered()), this, SLOT(removeCharacter()));
-	connect(this, SIGNAL(doubleClicked(const QModelIndex &)),this, SLOT(viewDoubleClicked(const QModelIndex &)));
+	connect(this, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(viewDoubleClicked(const QModelIndex &)));
 
 	actionMenu = new QMenu(this);
 	actionMenu->addAction(deleteAct);

Modified: trunk/Scribus/scribus/pdfversion.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/pdfversion.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfversion.cpp	(original)
+++ trunk/Scribus/scribus/pdfversion.cpp	Tue May 19 22:51:42 2020
@@ -60,5 +60,5 @@
 
 bool PDFVersion::supportsPDF15PresentationEffects() const
 {
-	return m_version == PDF_15 || m_version == PDF_16;
+	return (m_version == PDF_15 || m_version == PDF_16);
 }

Modified: trunk/Scribus/scribus/text/specialchars.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/text/specialchars.cpp
==============================================================================
--- trunk/Scribus/scribus/text/specialchars.cpp	(original)
+++ trunk/Scribus/scribus/text/specialchars.cpp	Tue May 19 22:51:42 2020
@@ -77,7 +77,7 @@
 	if (isLatin1 && isCJK2)
 		return true;
 	bool isLatin2 = SpecialChars::isLetterRequiringSpaceAroundCJK(c2);
-	return isCJK1 && isLatin2;
+	return (isCJK1 && isLatin2);
 }
 
 bool SpecialChars::isBreak(QChar c, bool includeColBreak)

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp	(original)
+++ trunk/Scribus/scribus/text/storytext.cpp	Tue May 19 22:51:42 2020
@@ -126,7 +126,7 @@
 	}
 
 	const ParagraphStyle& trailingStyle = d->trailingStyle;
-	return trailingStyle.hasBullet() || trailingStyle.hasNum();
+	return (trailingStyle.hasBullet() || trailingStyle.hasNum());
 }
 
 bool StoryText::hasTextMarks() const

Modified: trunk/Scribus/scribus/ui/pagepalette_pages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/ui/pagepalette_pages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_pages.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_pages.cpp	Tue May 19 22:51:42 2020
@@ -372,7 +372,7 @@
 		//QString tmp = tmp.setNum(nr+1);
 		QString tmp(currView->m_doc->getSectionPageNumberForPageIndex(number));
 		if (tmp.isEmpty())
-			tmp = tmp.setNum(number+1);
+			tmp = tmp.setNum(number + 1);
 		QRegExp Exp ("([A-Z]*[0-9]*)( *[\\.|\\-|_] *)(.*)");
 		if (Exp.indexIn(masterPage) != -1)
 			masterPage = Exp.cap(1);

Modified: trunk/Scribus/scribus/ui/resourcemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/ui/resourcemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/resourcemanager.cpp	(original)
+++ trunk/Scribus/scribus/ui/resourcemanager.cpp	Tue May 19 22:51:42 2020
@@ -938,9 +938,9 @@
 	dataReceivedLabel->setVisible(true);
 	downloadProgressBar->setRange(0, m_dataFiles.count());
 	for (const QString& f : qAsConst(m_dataFiles))
-		ScQApp->dlManager()->addURL("http://services.scribus.net/"+f, true, ScPaths::downloadDir(), ScPaths::downloadDir());
+		ScQApp->dlManager()->addURL("http://services.scribus.net/" + f, true, ScPaths::downloadDir(), ScPaths::downloadDir());
 	for (const QString& f : qAsConst(m_dataFiles))
-		ScQApp->dlManager()->addURL("http://services.scribus.net/"+f+".sha256", true, ScPaths::downloadDir(), ScPaths::downloadDir());
+		ScQApp->dlManager()->addURL("http://services.scribus.net/" + f + ".sha256", true, ScPaths::downloadDir(), ScPaths::downloadDir());
 	connect(ScQApp->dlManager(), SIGNAL(finished()), this, SLOT(downloadListFinished()));
 	connect(ScQApp->dlManager(), SIGNAL(fileReceived(const QString&)), this, SLOT(updateProgressBar()));
 	connect(ScQApp->dlManager(), SIGNAL(fileFailed(const QString&)), this, SLOT(updateProgressBar()));

Modified: trunk/Scribus/scribus/units.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/units.cpp
==============================================================================
--- trunk/Scribus/scribus/units.cpp	(original)
+++ trunk/Scribus/scribus/units.cpp	Tue May 19 22:51:42 2020
@@ -37,15 +37,14 @@
 	// a zero value if they are accessing here with a correct index.
 	if (index<UNITMIN || index>UNITMAX)
 		return 0;
-	//                  PT,        MM,       IN,   P,             CM,               C,   °,   %
-	double ratio[] = { 1.0, 25.4/72.0, 1.0/72.0, 1.0,      2.54/72.0, 25.4/72.0/4.512, 1.0, 1.0 };
-// 	double ratio[] = { 1.0, 25.4/72.0, 1.0/72.0, 1.0/12.0, 2.54/72.0, 25.4/72.0/4.512, 1.0, 1.0 };
+	//                  PT,          MM,         IN,   P,           CM,           C,           °,   %
+	double ratio[] = { 1.0, 25.4 / 72.0, 1.0 / 72.0, 1.0,  2.54 / 72.0, 25.4 / 72.0 / 4.512, 1.0, 1.0 };
 	return ratio[index];
 }
 
 int SCRIBUS_API unitGetBaseFromIndex(const int index)
 {
-	if (index==SC_P)
+	if (index == SC_P)
 		return 12;
 	return 10;
 }
@@ -101,38 +100,38 @@
 	scUnit retVal;
 	if (lowerValue.indexOf("pt") != -1)
 	{
-		retVal=SC_PT;
+		retVal = SC_PT;
 	}
 	else if (lowerValue.indexOf("mm") != -1)
 	{
-		retVal=SC_MM;
+		retVal = SC_MM;
 	}
 	else if (lowerValue.indexOf("in") != -1)
 	{
-		retVal=SC_IN;
+		retVal = SC_IN;
 	}
 	else if (lowerValue.indexOf("p") != -1)
 	{
-		retVal=SC_P;
+		retVal = SC_P;
 	}
 	else if (lowerValue.indexOf("cm") != -1)
 	{
-		retVal=SC_CM;
+		retVal = SC_CM;
 	}
 	else if (lowerValue.indexOf("c") != -1)
 	{
-		retVal=SC_C;
+		retVal = SC_C;
 	}	
 	else if (lowerValue.indexOf("°") != -1)
 	{
-		retVal=SC_DEGREES;
+		retVal = SC_DEGREES;
 	}
 	else if (lowerValue.indexOf("%") != -1)
 	{
-		retVal=SC_PERCENT;
+		retVal = SC_PERCENT;
 	}	
 	else
-		retVal=SC_PT;
+		retVal = SC_PT;
 	return retVal;
 }
 
@@ -141,8 +140,8 @@
  */
 QString unitGetSuffixFromIndex(const int index)
 {
-	if (index==SC_P)
-		return "";
+	if (index == SC_P)
+		return QString();
 	return QString(" %1").arg(unitGetStrFromIndex(index));
 }
 
@@ -151,8 +150,8 @@
  */
 QString unitGetStrFromIndex(const int index)
 {
-	if (index<UNITMIN || index>UNITMAX) 
-		return "";
+	if (index < UNITMIN || index > UNITMAX) 
+		return QString();
 	QString suffix[] = {
 						QObject::tr("pt"), 
 						QObject::tr("mm"), 
@@ -171,8 +170,8 @@
  */
 QString unitGetUntranslatedStrFromIndex(const int index)
 {
-	if (index<UNITMIN || index>UNITMAX) 
-		return "";
+	if (index < UNITMIN || index > UNITMAX) 
+		return QString();
 	QString suffix[] = { "pt", "mm", "in", "p", "cm", "c", "\xB0", "%" };
 	return suffix[index];
 }
@@ -181,7 +180,7 @@
  */
 int unitGetDecimalsFromIndex(const int index)
 {
-	if (index<UNITMIN || index>UNITMAX) 
+	if (index < UNITMIN || index > UNITMAX) 
 		return 0;
 	//                      PT,   MM,    IN,   P,    CM,     C,   °,   %
 	int decimalPoints[] = {100, 1000, 10000, 100, 10000, 10000, 100, 100};
@@ -193,7 +192,7 @@
  */
 int unitGetPrecisionFromIndex(const int index)
 {
-	if (index<UNITMIN || index>UNITMAX) 
+	if (index < UNITMIN || index > UNITMAX) 
 		return 0;
 	//                PT,MM,IN, P,CM, C, °, %
 	int precision[] = {2, 3, 4, 2, 4, 4, 2, 2};
@@ -392,8 +391,8 @@
 {
 	if (!unitValidForDocUnit(index)) 
 		return 0;
-	//                 PT,         MM,   IN,    P,        CM,               C     °,    %
-	double iter[] = {10.0, 720.0/25.4, 18.0, 12.0, 72.0/25.4, 72.0/25.4*4.512, 10.0, 10.0};
+	//                 PT,           MM,   IN,    P,          CM,                   C,    °,    %
+	double iter[] = {10.0, 720.0 / 25.4, 18.0, 12.0, 72.0 / 25.4, 72.0 / 25.4 * 4.512, 10.0, 10.0};
 	return iter[index];
 }
 
@@ -404,8 +403,8 @@
 {
 	if (!unitValidForDocUnit(index))
 		return 0;
-	//                  PT,          MM,   IN,     P,         CM,                C,     °,     %
-	double iter[] = {100.0, 7200.0/25.4, 72.0, 120.0, 720.0/25.4, 720.0/25.4*4.512, 100.0, 100.0};
+	//                  PT,            MM,   IN,     P,           CM,                    C,     °,     %
+	double iter[] = {100.0, 7200.0 / 25.4, 72.0, 120.0, 720.0 / 25.4, 720.0 / 25.4 * 4.512, 100.0, 100.0};
 	return iter[index];
 }
 

Modified: trunk/Scribus/scribus/units.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/units.h
==============================================================================
--- trunk/Scribus/scribus/units.h	(original)
+++ trunk/Scribus/scribus/units.h	Tue May 19 22:51:42 2020
@@ -52,7 +52,7 @@
 int SCRIBUS_API unitGetBaseFromIndex(const int index);
 QString SCRIBUS_API unitGetStrFromIndex(const int index);
 QString SCRIBUS_API unitGetUntranslatedStrFromIndex(const int index);
-QString unitGetSuffixFromIndex(const int index);
+QString SCRIBUS_API unitGetSuffixFromIndex(const int index);
 int SCRIBUS_API unitGetDecimalsFromIndex(const int index);
 int SCRIBUS_API unitGetPrecisionFromIndex(const int index);
 double SCRIBUS_API unitValueFromString(const QString& value);

Modified: trunk/Scribus/scribus/util_color.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/util_color.cpp
==============================================================================
--- trunk/Scribus/scribus/util_color.cpp	(original)
+++ trunk/Scribus/scribus/util_color.cpp	Tue May 19 22:51:42 2020
@@ -121,7 +121,7 @@
 	bool softProofing = doc ? doc->SoftProofing : false;
 	if (cmsUse && softProofing)
 	{
-		int outheight=out.height();
+		int outheight = out.height();
 		for (int i=0; i < outheight; ++i)
 		{
 			uchar* ptr = out.scanLine(i);
@@ -149,7 +149,7 @@
 		return {0, 0, 0, 0};
 	const ScColor& col = currentDoc->PageColors[color];
 	return ScColorEngine::getShadeColorProof(col, currentDoc, shad);
-		}
+}
 
 /**
  * QPixmaps are really slow with Qt/Mac 3.3.4. Really, *really*, slow.

Modified: trunk/Scribus/scribus/vgradientex.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/vgradientex.cpp
==============================================================================
--- trunk/Scribus/scribus/vgradientex.cpp	(original)
+++ trunk/Scribus/scribus/vgradientex.cpp	Tue May 19 22:51:42 2020
@@ -135,7 +135,7 @@
 	clearStops();
 }
 
-QList<VColorStopEx*> VGradientEx::colorStops() const
+const QList<VColorStopEx*>& VGradientEx::colorStops() const
 {
 	return m_colorStops;
 }

Modified: trunk/Scribus/scribus/vgradientex.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23821&path=/trunk/Scribus/scribus/vgradientex.h
==============================================================================
--- trunk/Scribus/scribus/vgradientex.h	(original)
+++ trunk/Scribus/scribus/vgradientex.h	Tue May 19 22:51:42 2020
@@ -32,6 +32,7 @@
 #include "fpoint.h"
 #include "sccolor.h"
 #include "scribusapi.h"
+
 class ScribusDoc;
 class VGradient;
 
@@ -115,7 +116,7 @@
 	VGradientEx::RepeatMethod repeatMethod() const { return m_repeatMethod; }
 	void setRepeatMethod(VGradientEx::RepeatMethod repeatMethod) { m_repeatMethod = repeatMethod; }
 
-	QList<VColorStopEx*> colorStops() const;
+	const QList<VColorStopEx*>& colorStops() const;
 	void addStop(const VColorStopEx& colorStop);
 	void addStop(const ScColor &color, double rampPoint, double midPoint, double opa, const QString& name = QString(), int shade = 100);
 	void removeStop(VColorStopEx& colorStop);




More information about the scribus-commit mailing list