r23154 by jghali - Small optimization for style combos updateFormatList()

scribus-commit scribus-commit at lists.scribus.net
Fri Aug 23 15:30:38 UTC 2019


Author: jghali
Date: Fri Aug 23 15:30:38 2019
New Revision: 23154

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23154
Log:
Small optimization for style combos updateFormatList()

Modified:
    trunk/Scribus/scribus/ui/spalette.cpp

Modified: trunk/Scribus/scribus/ui/spalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23154&path=/trunk/Scribus/scribus/ui/spalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/spalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/spalette.cpp	Fri Aug 23 15:30:38 2019
@@ -60,10 +60,11 @@
 	{
 		QStringList st;
 		addItem( CommonStrings::trDefaultParagraphStyle );
-		for (int x = 0; x < currentDoc->paragraphStyles().count(); ++x)
-		{
-			if ( !currentDoc->paragraphStyles()[x].name().isEmpty() && !currentDoc->paragraphStyles()[x].isDefaultStyle())
-				st.append(currentDoc->paragraphStyles()[x].name());
+		for (int i = 0; i < currentDoc->paragraphStyles().count(); ++i)
+		{
+			const ParagraphStyle& paraStyle = currentDoc->paragraphStyles()[i];
+			if (!paraStyle.name().isEmpty() && !paraStyle.isDefaultStyle())
+				st.append(paraStyle.name());
 		}
 		st.sort();
 		addItems(st);
@@ -124,11 +125,11 @@
 	{
 		QStringList st;
 		addItem( CommonStrings::trDefaultCharacterStyle );
-		for (int x = 0; x < currentDoc->charStyles().count(); ++x)
-		{
-			if ( !currentDoc->charStyles()[x].name().isEmpty() &&
-			    !currentDoc->charStyles()[x].isDefaultStyle())
-				st.append(currentDoc->charStyles()[x].name());
+		for (int i = 0; i < currentDoc->charStyles().count(); ++i)
+		{
+			const CharStyle& charStyle = currentDoc->charStyles()[i];
+			if (!charStyle.name().isEmpty() && !charStyle.isDefaultStyle())
+				st.append(charStyle.name());
 		}
 		st.sort();
 		addItems(st);
@@ -189,11 +190,11 @@
 	{
 		QStringList st;
 		addItem( CommonStrings::trDefaultCellStyle  );
-		for (int x = 0; x < currentDoc->cellStyles().count(); ++x)
-		{
-			if ( !currentDoc->cellStyles()[x].name().isEmpty() &&
-			    !currentDoc->cellStyles()[x].isDefaultStyle())
-				st.append(currentDoc->cellStyles()[x].name());
+		for (int i = 0; i < currentDoc->cellStyles().count(); ++i)
+		{
+			const CellStyle& cellStyle = currentDoc->cellStyles()[i];
+			if (!cellStyle.name().isEmpty() && !cellStyle.isDefaultStyle())
+				st.append(cellStyle.name());
 		}
 		st.sort();
 		addItems(st);
@@ -255,11 +256,11 @@
 	{
 		QStringList st;
 		addItem( CommonStrings::trDefaultTableStyle );
-		for (int x = 0; x < currentDoc->tableStyles().count(); ++x)
-		{
-			if ( !currentDoc->tableStyles()[x].name().isEmpty() &&
-			    !currentDoc->tableStyles()[x].isDefaultStyle())
-				st.append(currentDoc->tableStyles()[x].name());
+		for (int i = 0; i < currentDoc->tableStyles().count(); ++i)
+		{
+			const TableStyle& tableStyle = currentDoc->tableStyles()[i];
+			if (!tableStyle.name().isEmpty() && !tableStyle.isDefaultStyle())
+				st.append(tableStyle.name());
 		}
 		st.sort();
 		addItems(st);




More information about the scribus-commit mailing list