r23637 by jghali - Code readability improvements

scribus-commit scribus-commit at lists.scribus.net
Tue Apr 21 22:48:52 UTC 2020


Author: jghali
Date: Tue Apr 21 22:48:52 2020
New Revision: 23637

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

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23637&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h	Tue Apr 21 22:48:52 2020
@@ -211,7 +211,7 @@
 		QMap<int, int> itemNextF;
 		QMap<int, int> itemRemapM;
 		QMap<int, int> itemNextM;
-		QMap<int,PageItem*> LinkID;
+		QMap<int, PageItem*> LinkID;
 		QList<PageItem*> FrameItems;
 		QMap<PageItem*, QString> itemsWeld;  //item* and master name
 

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23637&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	Tue Apr 21 22:48:52 2020
@@ -1300,6 +1300,7 @@
 	//write list of definied marks to SLA
 	if (m_Doc->marksList().isEmpty())
 		return;
+
 	docu.writeStartElement("Marks");
 	foreach(Mark* mrk, m_Doc->marksList())
 	{
@@ -1337,12 +1338,12 @@
 	QList<NotesStyle*>::Iterator end = m_Doc->m_docNotesStylesList.end();
 	for (itNS = m_Doc->m_docNotesStylesList.begin(); itNS != end; ++itNS)
 	{
-		NotesStyle* NS = (*itNS);
+		NotesStyle* noteStyle = (*itNS);
 		docu.writeEmptyElement("notesStyle");
-		docu.writeAttribute("Name", NS->name());
-		docu.writeAttribute("Start", NS->start());
-		docu.writeAttribute("Endnotes", NS->isEndNotes());
-		switch (NS->getType())
+		docu.writeAttribute("Name", noteStyle->name());
+		docu.writeAttribute("Start", noteStyle->start());
+		docu.writeAttribute("Endnotes", noteStyle->isEndNotes());
+		switch (noteStyle->getType())
 		{
 			case Type_1_2_3:
 				docu.writeAttribute("Type", "Type_1_2_3");
@@ -1381,17 +1382,17 @@
 				docu.writeAttribute("Type", "Type_None");
 				break;
 		}
-		docu.writeAttribute("Range", (int) NS->range());
-		docu.writeAttribute("Prefix", NS->prefix());
-		docu.writeAttribute("Suffix", NS->suffix());
-		docu.writeAttribute("AutoHeight", NS->isAutoNotesHeight());
-		docu.writeAttribute("AutoWidth", NS->isAutoNotesWidth());
-		docu.writeAttribute("AutoRemove", NS->isAutoRemoveEmptyNotesFrames());
-		docu.writeAttribute("AutoWeld", NS->isAutoWeldNotesFrames());
-		docu.writeAttribute("SuperNote", NS->isSuperscriptInNote());
-		docu.writeAttribute("SuperMaster", NS->isSuperscriptInMaster());
-		docu.writeAttribute("MarksStyle", NS->marksChStyle());
-		docu.writeAttribute("NotesStyle", NS->notesParStyle());
+		docu.writeAttribute("Range", (int) noteStyle->range());
+		docu.writeAttribute("Prefix", noteStyle->prefix());
+		docu.writeAttribute("Suffix", noteStyle->suffix());
+		docu.writeAttribute("AutoHeight", noteStyle->isAutoNotesHeight());
+		docu.writeAttribute("AutoWidth", noteStyle->isAutoNotesWidth());
+		docu.writeAttribute("AutoRemove", noteStyle->isAutoRemoveEmptyNotesFrames());
+		docu.writeAttribute("AutoWeld", noteStyle->isAutoWeldNotesFrames());
+		docu.writeAttribute("SuperNote", noteStyle->isSuperscriptInNote());
+		docu.writeAttribute("SuperMaster", noteStyle->isSuperscriptInMaster());
+		docu.writeAttribute("MarksStyle", noteStyle->marksChStyle());
+		docu.writeAttribute("NotesStyle", noteStyle->notesParStyle());
 	}
 	docu.writeEndElement();
 }
@@ -1400,35 +1401,35 @@
 {
 	docu.writeStartElement("NotesFrames");
 
-	QList<PageItem_NoteFrame*> NFList;
-	foreach (NotesStyle* NS, m_Doc->m_docNotesStylesList)
-		NFList.append(m_Doc->listNotesFrames(NS));
-
-	for (int it = 0; it < NFList.count(); ++it)
-	{
-		PageItem_NoteFrame* nF = NFList.at(it);
-		NotesStyle* NS = nF->notesStyle();
-		if (NS->isEndNotes())
+	QList<PageItem_NoteFrame*> nfList;
+	foreach (NotesStyle* noteStyle, m_Doc->m_docNotesStylesList)
+		nfList.append(m_Doc->listNotesFrames(noteStyle));
+
+	for (int it = 0; it < nfList.count(); ++it)
+	{
+		PageItem_NoteFrame* noteFrame = nfList.at(it);
+		NotesStyle* noteStyle = noteFrame->notesStyle();
+		if (noteStyle->isEndNotes())
 		{
 			docu.writeEmptyElement("ENDNOTEFRAME");
-			docu.writeAttribute("NSname", NS->name());
-			docu.writeAttribute("range", (int) NS->range());
-			docu.writeAttribute("myID", qHash(nF) & 0x7FFFFFFF);
-			//docu.writeAttribute("name", nF->itemName());
+			docu.writeAttribute("NSname", noteStyle->name());
+			docu.writeAttribute("range", (int) noteStyle->range());
+			docu.writeAttribute("myID", qHash(noteFrame) & 0x7FFFFFFF);
+			//docu.writeAttribute("name", noteFrame->itemName());
 			
-			rangeItem rI = m_Doc->m_docEndNotesFramesMap.value(nF);
-			if (NS->range() == NSRstory)
+			rangeItem rI = m_Doc->m_docEndNotesFramesMap.value(noteFrame);
+			if (noteStyle->range() == NSRstory)
 				docu.writeAttribute("ItemID", qHash(rI.firstStoryFrame) & 0x7FFFFFFF);
 				//docu.writeAttribute("item", rI.firstStoryFrame->itemName());
 		}
 		else //footnotes frame
 		{
 			docu.writeEmptyElement("FOOTNOTEFRAME");
-			docu.writeAttribute("NSname", NS->name());
-			docu.writeAttribute("myID", qHash(nF) & 0x7FFFFFFF);
-			//docu.writeAttribute("name", nF->itemName());
-			docu.writeAttribute("MasterID", qHash(nF->masterFrame()) & 0x7FFFFFFF);
-			//docu.writeAttribute("master",nF->masterFrame()->itemName());
+			docu.writeAttribute("NSname", noteStyle->name());
+			docu.writeAttribute("myID", qHash(noteFrame) & 0x7FFFFFFF);
+			//docu.writeAttribute("name", noteFrame->itemName());
+			docu.writeAttribute("MasterID", qHash(noteFrame->masterFrame()) & 0x7FFFFFFF);
+			//docu.writeAttribute("master", noteFrame->masterFrame()->itemName());
 		}
 	}
 	docu.writeEndElement();
@@ -1442,7 +1443,7 @@
 	docu.writeStartElement("Notes");
 	QList<TextNote*>::const_iterator itTN;
 	QList<TextNote*>::const_iterator end = m_Doc->notesList().end();
-	for (itTN = m_Doc->notesList().begin(); itTN != end; ++itTN)
+	for (auto itTN = m_Doc->notesList().begin(); itTN != end; ++itTN)
 	{
 		TextNote* TN = (*itTN);
 		if (TN->masterMark() == nullptr)




More information about the scribus-commit mailing list