r24778 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 7 22:41:36 UTC 2021


Author: jghali
Date: Tue Dec  7 22:41:36 2021
New Revision: 24778

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

Modified:
    trunk/Scribus/scribus/langmgr.cpp
    trunk/Scribus/scribus/pdflib_core.cpp

Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24778&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp	(original)
+++ trunk/Scribus/scribus/langmgr.cpp	Tue Dec  7 22:41:36 2021
@@ -706,7 +706,7 @@
 void LanguageManager::generateInstalledSpellLangList()
 {
 	QStringList dictionaryPaths;
-	bool dictPathFound=findSpellingDictionaries(dictionaryPaths);
+	bool dictPathFound = findSpellingDictionaries(dictionaryPaths);
 	if (!dictPathFound)
 	{
 		qDebug()<<"No preinstalled spelling dictionaries or paths found";
@@ -753,7 +753,7 @@
 //	qDebug()<<"Trying to find:"<<langAbbrev;
 	int i=langTableIndex(langAbbrev);
 //	qDebug()<<"Index of"<<langAbbrev<<":"<<i;
-	if (i==-1)
+	if (i == -1)
 	{
 		if (langAbbrev.length() > 5)
 		{
@@ -938,7 +938,7 @@
 			i = langTableIndex(langAbbrev);
 		}
 	}
-	if (i !=-1)
+	if (i != -1)
 		return m_langTable[i].m_transAvailable;
 	return false;
 }
@@ -949,9 +949,9 @@
 	for (int i = 0; i < m_langTable.size(); ++i)
 	{
 		if (getTranslated)
-			sl<<m_langTable[i].m_transName;
+			sl << m_langTable[i].m_transName;
 		else
-			sl<<m_langTable[i].m_name;
+			sl << m_langTable[i].m_name;
 	}
 	sl.sort();
 	return sl;
@@ -1011,7 +1011,7 @@
 			retSeq += "";
 			break;
 		default:
-			retSeq="0123456789";
+			retSeq = "0123456789";
 			break;
 	}
 	return retSeq;
@@ -1019,13 +1019,13 @@
 
 bool LanguageManager::findSpellingDictionaries(QStringList &sl)
 {
-	sl=ScPaths::instance().spellDirs();
+	sl = ScPaths::instance().spellDirs();
 	return sl.count() != 0;
 }
 
 void LanguageManager::findSpellingDictionarySets(QStringList &dictionaryPaths, QMap<QString, QString> &dictionaryMap)
 {
-	for (int i = 0; i<dictionaryPaths.count(); ++i)
+	for (int i = 0; i < dictionaryPaths.count(); ++i)
 	{
 		// Find the dic and aff files in the location
 		QDir dictLocation(dictionaryPaths.at(i));
@@ -1047,7 +1047,7 @@
 			{
 				//QString shortAbbrev(LanguageManager::getShortAbbrevFromAbbrev(dictName));
 				//qDebug()<<"findSpellingDictionarySets"<<dictName<<shortAbbrev;
-				dictionaryMap.insert(dictName, dictionaryPaths.at(i)+dictName);
+				dictionaryMap.insert(dictName, dictionaryPaths.at(i) + dictName);
 				//dictionaryMap.insert(shortAbbrev, dictionaryPaths.at(i)+dictName);
 			}
 			//qDebug()<<"Spell Finder:"<<dictName<<dictionaryPaths.at(i)+dictName;
@@ -1055,11 +1055,12 @@
 			{
 				QString shortAbbrev(LanguageManager::getShortAbbrevFromAbbrev(dictName));
 				//qDebug()<<shortAbbrev;
-				dictionaryMap.insert(shortAbbrev, dictionaryPaths.at(i)+dictName);
+				dictionaryMap.insert(shortAbbrev, dictionaryPaths.at(i) + dictName);
 			}
 		}
 //		qDebug()<<"Number of dictionaries/AFFs found in"<<dictionaryPaths.at(i)<<":"<<dictList.count();
 	}
+
 	//Now rescan dictionary map for any extra languages we can support with the files we have
 	QMap<QString, QString>::iterator it = dictionaryMap.begin();
 	while (it != dictionaryMap.end())
@@ -1093,40 +1094,40 @@
 
 bool LanguageManager::findHyphDictionaries(QStringList& sl)
 {
-	sl=ScPaths::instance().hyphDirs();
+	sl = ScPaths::instance().hyphDirs();
 	return sl.count() != 0;
 }
 
 void LanguageManager::findHyphDictionarySets(QStringList& dictionaryPaths, QMap<QString, QString>& dictionaryMap)
 {
-	for (int i = 0; i<dictionaryPaths.count(); ++i)
+	for (int i = 0; i < dictionaryPaths.count(); ++i)
 	{
 		// Find the dic and aff files in the location
 		QDir dictLocation(dictionaryPaths.at(i));
 		QStringList dictFilters("hyph*.dic");
-		if (dictionaryPaths.at(i)==ScPaths::userDictDir(ScPaths::Hyph, false))
+		if (dictionaryPaths.at(i) == ScPaths::userDictDir(ScPaths::Hyph, false))
 			dictFilters.append("*.dic");
 		QStringList dictList(dictLocation.entryList(dictFilters, QDir::Files, QDir::Name));
-		dictList.replaceInStrings(".dic","");
+		dictList.replaceInStrings(".dic", "");
 
 		for (const QString& dn : qAsConst(dictList))
 		{
 //			qDebug()<<dn;
 			QString dictName;
 			if (dn.startsWith("hyph_"))
-				dictName = dn.section('_',1);
+				dictName = dn.section('_', 1);
 			else
 				dictName = dn;
 			if (dictionaryMap.contains(dictName))
 				continue;
 			if (dictName.length() <= 2)
 			{
-				dictionaryMap.insert(dictName, dictionaryPaths.at(i)+dn+".dic");
+				dictionaryMap.insert(dictName, dictionaryPaths.at(i) + dn + ".dic");
 			}
 			if (dictName.length() > 2)
 			{
 				QString shortAbbrev(LanguageManager::getShortAbbrevFromAbbrev(dictName));
-				dictionaryMap.insert(shortAbbrev, dictionaryPaths.at(i)+dn+".dic");
+				dictionaryMap.insert(shortAbbrev, dictionaryPaths.at(i) + dn + ".dic");
 			}
 		}
 	}
@@ -1147,4 +1148,3 @@
 	}
 	return QString();
 }
-

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24778&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp	(original)
+++ trunk/Scribus/scribus/pdflib_core.cpp	Tue Dec  7 22:41:36 2021
@@ -3523,7 +3523,7 @@
 			QString docDate = tr("Date:") + " " + d.toString(Qt::TextDate);
 			PutPage("q\n");
 			PutPage("1 0 0 1 " + FToStr(maxBoxX / 2.0 + 20.0) + " " + FToStr(startY) + " cm\n");
-			painter2.addText( QPointF(0.0,0.0), infoFont, docDate );
+			painter2.addText( QPointF(0.0, 0.0), infoFont, docDate );
 			textPath.fromQPainterPath(painter2);
 			PutPage(SetClipPathArray(&textPath, true));
 			PutPage("h\nf*\n");




More information about the scribus-commit mailing list