r24223 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 11 11:27:13 UTC 2020


Author: jghali
Date: Wed Nov 11 11:27:13 2020
New Revision: 24223

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

Modified:
    trunk/Scribus/scribus/prefsmanager.cpp

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24223&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp	(original)
+++ trunk/Scribus/scribus/prefsmanager.cpp	Wed Nov 11 11:27:13 2020
@@ -860,7 +860,7 @@
 	if (existsPrefs150[0] && existsPrefs150[2])
 		return retVal;
 	//Only check for these three as they will be autocreated if they don't exist.
-	if( (existsPrefs135[0] && !existsPrefs140[0]) || (existsPrefs135[2] && !existsPrefs140[2]) )
+	if ((existsPrefs135[0] && !existsPrefs140[0]) || (existsPrefs135[2] && !existsPrefs140[2]))
 	{
 		// Now always return false
 		// retVal=true; // converting from 1.2 prefs
@@ -1791,29 +1791,32 @@
 		dcExternalTools.appendChild(domConfig);
 	}
 	elem.appendChild(dcExternalTools);
+
 	QDomElement rde = docu.createElement("Hyphenator");
 	rde.setAttribute("Automatic", static_cast<int>(appPrefs.hyphPrefs.Automatic));
 	rde.setAttribute("AutomaticCheck", static_cast<int>(appPrefs.hyphPrefs.AutoCheck));
 	for (auto hyit = appPrefs.hyphPrefs.specialWords.begin(); hyit != appPrefs.hyphPrefs.specialWords.end(); ++hyit)
 	{
-		QDomElement hyelm = docu.createElement("Exception");
-		hyelm.setAttribute("Word", hyit.key());
-		hyelm.setAttribute("Hyphenated", hyit.value());
-		rde.appendChild(hyelm);
+		QDomElement hyElem = docu.createElement("Exception");
+		hyElem.setAttribute("Word", hyit.key());
+		hyElem.setAttribute("Hyphenated", hyit.value());
+		rde.appendChild(hyElem);
 	}
 	for (auto hyit2 = appPrefs.hyphPrefs.ignoredWords.begin(); hyit2 != appPrefs.hyphPrefs.ignoredWords.end(); ++hyit2)
 	{
-		QDomElement hyelm2 = docu.createElement("Ignore");
-		hyelm2.setAttribute("Word", (*hyit2));
-		rde.appendChild(hyelm2);
+		QDomElement hyElem2 = docu.createElement("Ignore");
+		hyElem2.setAttribute("Word", (*hyit2));
+		rde.appendChild(hyElem2);
 	}
 	elem.appendChild(rde);
-	for (int rd=0; rd<appPrefs.uiPrefs.RecentDocs.count(); ++rd)
+
+	for (int i = 0; i < appPrefs.uiPrefs.RecentDocs.count(); ++i)
 	{
 		QDomElement rde = docu.createElement("Recent");
-		rde.setAttribute("Name", appPrefs.uiPrefs.RecentDocs[rd]);
+		rde.setAttribute("Name", appPrefs.uiPrefs.RecentDocs[i]);
 		elem.appendChild(rde);
 	}
+
 	for (auto ksc = appPrefs.keyShortcutPrefs.KeyActions.begin(); ksc!=appPrefs.keyShortcutPrefs.KeyActions.end(); ++ksc)
 	{
 		if (ksc.value().actionName.isEmpty())
@@ -1823,6 +1826,7 @@
 		kscc.setAttribute("KeySequence", Prefs_KeyboardShortcuts::getKeyText(ksc.value().keySequence));
 		elem.appendChild(kscc);
 	}
+
 	QDomElement cosd = docu.createElement("DefaultColorSet");
 	cosd.setAttribute("Name", appPrefs.colorPrefs.DColorSet);
 	elem.appendChild(cosd);
@@ -1942,7 +1946,7 @@
 	// write file
 	bool result = false;
 	QFile f(ho);
-	if(!f.open(QIODevice::WriteOnly))
+	if (!f.open(QIODevice::WriteOnly))
 	{
 		m_lastError = tr("Could not open preferences file \"%1\" for writing: %2").arg(ho, qApp->translate("QFile",f.errorString().toLatin1().constData()));
 	}
@@ -1965,7 +1969,7 @@
 {
 	QDomDocument docu("scridoc");
 	QFile f(ho);
-	if(!f.open(QIODevice::ReadOnly))
+	if (!f.open(QIODevice::ReadOnly))
 	{
 		m_lastError = tr("Failed to open prefs file \"%1\": %2").arg(ho, qApp->translate("QFile",f.errorString().toLatin1().constData()) );
 		return false;
@@ -1975,7 +1979,7 @@
 	QString errorMsg;
 	int errorLine = 0;
 	int errorColumn = 0;
-	if( !docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn) )
+	if (!docu.setContent(ts.readAll(), &errorMsg, &errorLine, &errorColumn))
 	{
 		m_lastError = tr("Failed to read prefs XML from \"%1\": %2 at line %3, col %4").arg(ho, errorMsg).arg(errorLine).arg(errorColumn);
 		f.close();
@@ -2008,7 +2012,7 @@
 	{
 		ScDomElement dc = DOC.toElement();
 
-		if (dc.tagName()=="UI")
+		if (dc.tagName() == "UI")
 		{
 			appPrefs.uiPrefs.style = dc.attribute("Theme", "Default");
 			appPrefs.uiPrefs.wheelJump = dc.attribute("ScrollWheelJump").toInt();
@@ -2026,7 +2030,7 @@
 			appPrefs.uiPrefs.userPreferredLocale = dc.attribute("UserPreferredLocale", "System");
 		}
 
-		if (dc.tagName()=="DocumentSetup")
+		if (dc.tagName() == "DocumentSetup")
 		{
 			appPrefs.docSetupPrefs.language = dc.attribute("Language", "en_GB");
 			appPrefs.docSetupPrefs.language = LanguageManager::instance()->getShortAbbrevFromAbbrevDecomposition(appPrefs.docSetupPrefs.language);
@@ -2057,7 +2061,7 @@
 
 		}
 
-		if (dc.tagName()=="Miscellaneous")
+		if (dc.tagName() == "Miscellaneous")
 		{
 			appPrefs.miscPrefs.haveStylePreview = static_cast<bool>(dc.attribute("ShowStylePreview", "1").toInt());
 			appPrefs.miscPrefs.useStandardLI = static_cast<bool>(dc.attribute("LoremIpsumUseStandard", "0").toInt());
@@ -2065,8 +2069,7 @@
 			appPrefs.miscPrefs.saveEmergencyFile = static_cast<bool>(dc.attribute("saveEmergencyFile", "1").toInt());
 		}
 
-
-		if (dc.tagName()=="Display")
+		if (dc.tagName() == "Display")
 		{
 			appPrefs.displayPrefs.scratch.setBottom(ScCLocale::toDoubleC(dc.attribute("ScratchBottom"), 20.0));
 			appPrefs.displayPrefs.scratch.setLeft(ScCLocale::toDoubleC(dc.attribute("ScratchLeft"), 100.0));
@@ -2095,14 +2098,14 @@
 			appPrefs.displayPrefs.showToolTips = static_cast<bool>(dc.attribute("ToolTips", "1").toInt());
 			appPrefs.displayPrefs.showMouseCoordinates = static_cast<bool>(dc.attribute("ShowMouseCoordinates", "1").toInt());
 		}
-		if (dc.tagName()=="Paths")
+		if (dc.tagName() == "Paths")
 		{
 			appPrefs.pathPrefs.documents = dc.attribute("Documents", "");
 			appPrefs.pathPrefs.colorProfiles = dc.attribute("Profiles", "");
 			appPrefs.pathPrefs.scripts = dc.attribute("Scripts", "");
 			appPrefs.pathPrefs.documentTemplates = dc.attribute("Templates", "");
 		}
-		if (dc.tagName()=="Guides")
+		if (dc.tagName() == "Guides")
 		{
 			appPrefs.guidesPrefs.grabRadius = dc.attribute("GrabRadius", "4").toInt();
 			appPrefs.guidesPrefs.guidesShown = static_cast<bool>(dc.attribute("ShowGuides", "1").toInt());
@@ -2153,13 +2156,13 @@
 			appPrefs.guidesPrefs.valueBaselineGrid   = ScCLocale::toDoubleC(dc.attribute("BaselineGridDistance"), 12.0);
 			appPrefs.guidesPrefs.offsetBaselineGrid  = ScCLocale::toDoubleC(dc.attribute("BaselineGridOffset"), 0.0);
 		}
-		if (dc.tagName()=="StoryEditor")
+		if (dc.tagName() == "StoryEditor")
 		{
 			appPrefs.storyEditorPrefs.guiFont  = dc.attribute("Font", "");
 			appPrefs.storyEditorPrefs.guiFontColorBackground  = QColor(dc.attribute("FontColorBackground", "#FFFFFF"));
 			appPrefs.storyEditorPrefs.smartTextSelection = static_cast<bool>(dc.attribute("SmartTextSelection", "0").toInt());
 		}
-		if (dc.tagName()=="Typography")
+		if (dc.tagName() == "Typography")
 		{
 			appPrefs.typoPrefs.valueSuperScript = dc.attribute("SuperScriptDistance").toInt();
 			appPrefs.typoPrefs.scalingSuperScript = dc.attribute("SuperScriptScaling").toInt();
@@ -2188,7 +2191,6 @@
 			else
 				appPrefs.typoPrefs.valueStrikeThruWidth = -1;
 		}
-
 
 		if (dc.tagName() == "ItemTools")
 		{
@@ -2272,7 +2274,7 @@
 			}
 		}
 
-		if (dc.tagName()=="OperatorTools")
+		if (dc.tagName() == "OperatorTools")
 		{
 			appPrefs.opToolPrefs.magMin  = dc.attribute("MinimumMagnification", "1").toInt();
 			appPrefs.opToolPrefs.magMax  = dc.attribute("MaximumMagnification", "32000").toInt();
@@ -2284,7 +2286,7 @@
 			appPrefs.opToolPrefs.constrain = ScCLocale::toDoubleC(dc.attribute("RotationConstrainAngle"), 15.0);
 		}
 
-		if (dc.tagName()=="MainWindow")
+		if (dc.tagName() == "MainWindow")
 		{
 			appPrefs.uiPrefs.mainWinSettings.xPosition = dc.attribute("XPosition", "0").toInt();
 			appPrefs.uiPrefs.mainWinSettings.yPosition = dc.attribute("YPosition", "0").toInt();
@@ -2327,7 +2329,7 @@
 				appPrefs.uiPrefs.mainWinSettings.yPosition = maxY;
 		}
 
-		if (dc.tagName()=="ScrapBook")
+		if (dc.tagName() == "ScrapBook")
 		{
 			appPrefs.scrapbookPrefs.doCopyToScrapbook = static_cast<bool>(dc.attribute("CopyToScrapbook", "1").toInt());
 			appPrefs.scrapbookPrefs.persistentScrapbook = static_cast<bool>(dc.attribute("PersistentScrapbook", "0").toInt());
@@ -2348,47 +2350,47 @@
 			}
 		}
 
-		if (dc.tagName()=="PageSets")
-		{
-			QDomNode PGS = DOC.firstChild();
-			if  (!PGS.namedItem("PageNames").isNull())
+		if (dc.tagName() == "PageSets")
+		{
+			QDomNode pgs = DOC.firstChild();
+			if (!pgs.namedItem("PageNames").isNull())
 			{
 				appPrefs.pageSets.clear();
-				while (!PGS.isNull())
+				while (!pgs.isNull())
 				{
-					QDomElement PgsAttr = PGS.toElement();
-					if(PgsAttr.tagName() == "Set")
+					QDomElement pgsAttr = pgs.toElement();
+					if (pgsAttr.tagName() == "Set")
 					{
 						struct PageSet pageS;
-						pageS.Name = PgsAttr.attribute("Name");
-						pageS.FirstPage = PgsAttr.attribute("FirstPage", "0").toInt();
-						pageS.Rows = PgsAttr.attribute("Rows", "1").toInt();
-						pageS.Columns = PgsAttr.attribute("Columns", "1").toInt();
-//						pageS.GapHorizontal = PgsAttr.attribute("GapHorizontal", "0").toDouble();
-//						pageS.GapVertical = PgsAttr.attribute("GapVertical", "0").toDouble();
-//						pageS.GapBelow = PgsAttr.attribute("GapBelow", "0").toDouble();
+						pageS.Name = pgsAttr.attribute("Name");
+						pageS.FirstPage = pgsAttr.attribute("FirstPage", "0").toInt();
+						pageS.Rows = pgsAttr.attribute("Rows", "1").toInt();
+						pageS.Columns = pgsAttr.attribute("Columns", "1").toInt();
+//						pageS.GapHorizontal = pgsAttr.attribute("GapHorizontal", "0").toDouble();
+//						pageS.GapVertical = pgsAttr.attribute("GapVertical", "0").toDouble();
+//						pageS.GapBelow = pgsAttr.attribute("GapBelow", "0").toDouble();
 						pageS.pageNames.clear();
-						QDomNode PGSN = PGS.firstChild();
-						while (!PGSN.isNull())
+						QDomNode pgsN = pgs.firstChild();
+						while (!pgsN.isNull())
 						{
-							QDomElement PgsAttrN = PGSN.toElement();
-							if(PgsAttrN.tagName() == "PageNames")
+							QDomElement PgsAttrN = pgsN.toElement();
+							if (PgsAttrN.tagName() == "PageNames")
 								pageS.pageNames.append(PgsAttrN.attribute("Name"));
-							PGSN = PGSN.nextSibling();
+							pgsN = pgsN.nextSibling();
 						}
 						appPrefs.pageSets.append(pageS);
 						if ((appPrefs.pageSets.count() == appPrefs.docSetupPrefs.pagePositioning) && ((appPrefs.displayPrefs.pageGapHorizontal < 0) && (appPrefs.displayPrefs.pageGapVertical < 0)))
 						{
-							appPrefs.displayPrefs.pageGapHorizontal = ScCLocale::toDoubleC(PgsAttr.attribute("GapHorizontal"), 0.0);
-							appPrefs.displayPrefs.pageGapVertical   = ScCLocale::toDoubleC(PgsAttr.attribute("GapBelow"), 40.0);
+							appPrefs.displayPrefs.pageGapHorizontal = ScCLocale::toDoubleC(pgsAttr.attribute("GapHorizontal"), 0.0);
+							appPrefs.displayPrefs.pageGapVertical   = ScCLocale::toDoubleC(pgsAttr.attribute("GapBelow"), 40.0);
 						}
 					}
-					PGS = PGS.nextSibling();
+					pgs = pgs.nextSibling();
 				}
 			}
 		}
 
-		if (dc.tagName()=="ColorManagement")
+		if (dc.tagName() == "ColorManagement")
 		{
 			appPrefs.colorPrefs.DCMSset.SoftProofOn = static_cast<bool>(dc.attribute("SoftProofOn", "0").toInt());
 			appPrefs.colorPrefs.DCMSset.SoftProofFullOn = static_cast<bool>(dc.attribute("SoftProofFullOn", "0").toInt());
@@ -2404,15 +2406,15 @@
 			appPrefs.colorPrefs.DCMSset.DefaultIntentColors = (eRenderIntent) dc.attribute("DefaultIntentColors", "1").toInt();
 			appPrefs.colorPrefs.DCMSset.DefaultIntentImages = (eRenderIntent) dc.attribute("DefaultIntentImages", "0").toInt();
 		}
-		if (!m_importingFrom12 && dc.tagName()=="Shortcut")
+		if (!m_importingFrom12 && dc.tagName() == "Shortcut")
 		{
 			appPrefs.keyShortcutPrefs.KeyActions[dc.attribute("Action")].actionName = dc.attribute("Action");
 			QKeySequence newKeySequence = QKeySequence(dc.attribute("KeySequence"));
 			appPrefs.keyShortcutPrefs.KeyActions[dc.attribute("Action")].keySequence = newKeySequence;
 		}
-		if (dc.tagName()=="Recent")
+		if (dc.tagName() == "Recent")
 			appPrefs.uiPrefs.RecentDocs.append(dc.attribute("Name"));
-		if (dc.tagName()=="PreflightVerifier")
+		if (dc.tagName() == "PreflightVerifier")
 		{
 			appPrefs.verifierPrefs.curCheckProfile = dc.attribute("CurrentProfile", CommonStrings::PDF_1_4);
 			appPrefs.verifierPrefs.showPagesWithoutErrors = static_cast<bool>(dc.attribute("ShowPagesWithoutErrors", "0").toInt());
@@ -2426,7 +2428,7 @@
 				appPrefs.verifierPrefs.curCheckProfile = CommonStrings::PostScript;
 			}
 		}
-		if (dc.tagName()=="VerifierProfile")
+		if (dc.tagName() == "VerifierProfile")
 		{
 			QString name=dc.attribute("Name");
 			if ((name == tr("PostScript")) ||  (name == tr("Postscript")) || (name == "Postscript"))
@@ -2456,7 +2458,7 @@
 			checkerSettings.checkEmptyTextFrames = static_cast<bool>(dc.attribute("CheckEmptyTextFrames", "1").toInt());
 			appPrefs.verifierPrefs.checkerPrefsList[name] = checkerSettings;
 		}
-		if (dc.tagName()=="Printer")
+		if (dc.tagName() == "Printer")
 		{
 			appPrefs.printerPrefs.PrinterName = dc.attribute("Name");
 			appPrefs.printerPrefs.PrinterFile = dc.attribute("File");
@@ -2464,7 +2466,7 @@
 			appPrefs.printerPrefs.ClipMargin = static_cast<bool>(dc.attribute("ClipToMargins", "1").toInt());
 			appPrefs.printerPrefs.GCRMode = static_cast<bool>(dc.attribute("GCRMode", "1").toInt());
 		}
-		if (dc.tagName()=="PrintPreview")
+		if (dc.tagName() == "PrintPreview")
 		{
 			appPrefs.printPreviewPrefs.PrPr_Mode = static_cast<bool>(dc.attribute("Mode", "0").toInt());
 			appPrefs.printPreviewPrefs.PrPr_AntiAliasing = static_cast<bool>(dc.attribute("AntiAliasing", "1").toInt());
@@ -2501,11 +2503,11 @@
 			appPrefs.psOutputPreviewPrefs.displayInkCoverage = static_cast<bool>(dc.attribute("InkCoverage", "0").toInt());
 			appPrefs.psOutputPreviewPrefs.inkCoverageThreshold = dc.attribute("InkThreshold", "250").toInt();
 		}
-		if (dc.tagName()=="ExternalTools")
+		if (dc.tagName() == "ExternalTools")
 		{
 			bool gsa1 = testGSAvailability(dc.attribute("Ghostscript", "gs"));
 			bool gsa2 = testGSAvailability(ghostscriptExecutable());
-			if( (gsa1) || (!gsa2) )
+			if ((gsa1) || (!gsa2))
 				setGhostscriptExecutable(dc.attribute("Ghostscript", "gs"));
 			appPrefs.extToolPrefs.gs_AntiAliasText = static_cast<bool>(dc.attribute("GhostscriptAntiAliasText", "0").toInt());
 			appPrefs.extToolPrefs.gs_AntiAliasGraphics = static_cast<bool>(dc.attribute("GhostscriptAntiAliasGraphics", "0").toInt());
@@ -2521,7 +2523,7 @@
 			QStringList configs = appPrefs.extToolPrefs.latexConfigs;
 			QDomNodeList configNodes = dc.elementsByTagName("LatexConfig");
 			QString latexBase = LatexConfigParser::configBase();
-			for (int i=0; i < configNodes.size(); i++)
+			for (int i = 0; i < configNodes.size(); ++i)
 			{
 				QString confFile = configNodes.at(i).toElement().attribute("file", "");
 				QString command  = configNodes.at(i).toElement().attribute("command", "");
@@ -2543,33 +2545,33 @@
 				appPrefs.extToolPrefs.latexCommands = LatexConfigCache::defaultCommands();
 			}
 		}
-		if (dc.tagName()=="Hyphenator")
+		if (dc.tagName() == "Hyphenator")
 		{
 			appPrefs.hyphPrefs.Automatic = static_cast<bool>(dc.attribute("Automatic", "1").toInt());
 			appPrefs.hyphPrefs.AutoCheck = static_cast<bool>(dc.attribute("AutomaticCheck", "1").toInt());
-			QDomNode hyelm = dc.firstChild();
-			while (!hyelm.isNull())
+			QDomNode hyNode = dc.firstChild();
+			while (!hyNode.isNull())
 			{
-				QDomElement hyElem = hyelm.toElement();
-				if (hyElem.tagName()=="Exception")
+				QDomElement hyElem = hyNode.toElement();
+				if (hyElem.tagName() == "Exception")
 				{
 					QString word = hyElem.attribute("Word");
 					QString hyph = hyElem.attribute("Hyphenated");
 					appPrefs.hyphPrefs.specialWords.insert(word, hyph);
 				}
-				else if (hyElem.tagName()=="Ignore")
+				else if (hyElem.tagName() == "Ignore")
 				{
 					QString word = hyElem.attribute("Word");
 					appPrefs.hyphPrefs.ignoredWords.insert(word);
 				}
-				hyelm = hyelm.nextSibling();
+				hyNode = hyNode.nextSibling();
 			}
 		}
-		if (dc.tagName()=="Fonts")
+		if (dc.tagName() == "Fonts")
 		{
 			appPrefs.fontPrefs.askBeforeSubstitute = static_cast<bool>(dc.attribute("AutomaticSubstitution", "1").toInt());
 		}
-		if (dc.tagName()=="Font")
+		if (dc.tagName() == "Font")
 		{
 			QString tmpf(dc.attribute("Name"));
 			if (!tmpf.isEmpty() && appPrefs.fontPrefs.AvailFonts.contains(tmpf))
@@ -2580,9 +2582,9 @@
 				face.subset(static_cast<bool>(dc.attribute("Subset", "0").toInt()));
 			}
 		}
-		if (dc.tagName()=="Substitute")
+		if (dc.tagName() == "Substitute")
 		  appPrefs.fontPrefs.GFontSub[dc.attribute("Name")] = dc.attribute("Replace");
-		if (dc.tagName()=="DefaultColorSet")
+		if (dc.tagName() == "DefaultColorSet")
 		{
 			appPrefs.colorPrefs.DColorSet = dc.attribute("Name");
 			if (appPrefs.colorPrefs.DColorSet == "Scribus Small")
@@ -2601,7 +2603,7 @@
 				appPrefs.colorPrefs.DColors.insert("Magenta", ScColor(0, 255, 0, 0));
 			}
 		}
-		if(dc.tagName()=="PDF")
+		if (dc.tagName() == "PDF")
 		{
 			appPrefs.pdfPrefs.Articles = static_cast<bool>(dc.attribute("Articles").toInt());
 			appPrefs.pdfPrefs.Thumbnails = static_cast<bool>(dc.attribute("Thumbnails").toInt());
@@ -2663,12 +2665,12 @@
 			appPrefs.pdfPrefs.openAfterExport = static_cast<bool>(dc.attribute("openAfterExport", "0").toInt());
 			appPrefs.pdfPrefs.PageLayout = dc.attribute("PageLayout", "0").toInt();
 			appPrefs.pdfPrefs.openAction = dc.attribute("OpenAction", "");
-			QDomNode PFO = DOC.firstChild();
+			QDomNode pfoNode = DOC.firstChild();
 			appPrefs.pdfPrefs.LPISettings.clear();
-			while (!PFO.isNull())
+			while (!pfoNode.isNull())
 			{
-				QDomElement pdfF = PFO.toElement();
-				if(pdfF.tagName() == "LPI")
+				QDomElement pdfF = pfoNode.toElement();
+				if (pdfF.tagName() == "LPI")
 				{
 					struct LPIData lpo;
 					lpo.Angle = pdfF.attribute("Angle").toInt();
@@ -2676,56 +2678,56 @@
 					lpo.SpotFunc = pdfF.attribute("SpotFunction").toInt();
 					appPrefs.pdfPrefs.LPISettings[pdfF.attribute("Color")] = lpo;
 				}
-				PFO = PFO.nextSibling();
+				pfoNode = pfoNode.nextSibling();
 			}
 		}
-		if(dc.tagName()=="DefaultItemAttributes")
-		{
-			QDomNode DIA = DOC.firstChild();
+		if (dc.tagName() == "DefaultItemAttributes")
+		{
+			QDomNode diaNode = DOC.firstChild();
 			appPrefs.itemAttrPrefs.defaultItemAttributes.clear();
-			while (!DIA.isNull())
+			while (!diaNode.isNull())
 			{
-				QDomElement itemAttr = DIA.toElement();
-				if(itemAttr.tagName() == "ItemAttribute")
+				QDomElement itemAttr = diaNode.toElement();
+				if (itemAttr.tagName() == "ItemAttribute")
 				{
-					ObjectAttribute objattr;
-					objattr.name=itemAttr.attribute("Name");
-					objattr.type=itemAttr.attribute("Type");
-					objattr.value=itemAttr.attribute("Value");
-					objattr.parameter=itemAttr.attribute("Parameter");
-					objattr.relationship=itemAttr.attribute("Relationship");
-					objattr.relationshipto=itemAttr.attribute("RelationshipTo");
-					objattr.autoaddto=itemAttr.attribute("AutoAddTo");
-					appPrefs.itemAttrPrefs.defaultItemAttributes.append(objattr);
+					ObjectAttribute objAttr;
+					objAttr.name = itemAttr.attribute("Name");
+					objAttr.type = itemAttr.attribute("Type");
+					objAttr.value = itemAttr.attribute("Value");
+					objAttr.parameter = itemAttr.attribute("Parameter");
+					objAttr.relationship = itemAttr.attribute("Relationship");
+					objAttr.relationshipto = itemAttr.attribute("RelationshipTo");
+					objAttr.autoaddto = itemAttr.attribute("AutoAddTo");
+					appPrefs.itemAttrPrefs.defaultItemAttributes.append(objAttr);
 				}
-				DIA = DIA.nextSibling();
+				diaNode = diaNode.nextSibling();
 			}
 		}
-		if(dc.tagName()=="TablesOfContents")
-		{
-			QDomNode TOC = DOC.firstChild();
+		if (dc.tagName() == "TablesOfContents")
+		{
+			QDomNode tocNode = DOC.firstChild();
 			appPrefs.tocPrefs.defaultToCSetups.clear();
-			while (!TOC.isNull())
+			while (!tocNode.isNull())
 			{
-				QDomElement tocElem = TOC.toElement();
-				if(tocElem.tagName() == "TableOfContents")
+				QDomElement tocElem = tocNode.toElement();
+				if (tocElem.tagName() == "TableOfContents")
 				{
 					ToCSetup tocsetup;
-					tocsetup.name=tocElem.attribute("Name");
-					tocsetup.itemAttrName=tocElem.attribute("ItemAttributeName");
-					tocsetup.frameName=tocElem.attribute("FrameName");
-					tocsetup.listNonPrintingFrames=static_cast<bool>(tocElem.attribute("ListNonPrinting").toInt());
-					tocsetup.textStyle=tocElem.attribute("Style");
-					QString numberPlacement=tocElem.attribute("NumberPlacement");
-					if (numberPlacement=="Beginning")
-						tocsetup.pageLocation=Beginning;
-					if (numberPlacement=="End")
-						tocsetup.pageLocation=End;
-					if (numberPlacement=="NotShown")
-						tocsetup.pageLocation=NotShown;
+					tocsetup.name = tocElem.attribute("Name");
+					tocsetup.itemAttrName = tocElem.attribute("ItemAttributeName");
+					tocsetup.frameName = tocElem.attribute("FrameName");
+					tocsetup.listNonPrintingFrames = static_cast<bool>(tocElem.attribute("ListNonPrinting").toInt());
+					tocsetup.textStyle = tocElem.attribute("Style");
+					QString numberPlacement = tocElem.attribute("NumberPlacement");
+					if (numberPlacement == "Beginning")
+						tocsetup.pageLocation = Beginning;
+					if (numberPlacement == "End")
+						tocsetup.pageLocation = End;
+					if (numberPlacement == "NotShown")
+						tocsetup.pageLocation = NotShown;
 					appPrefs.tocPrefs.defaultToCSetups.append(tocsetup);
 				}
-				TOC = TOC.nextSibling();
+				tocNode = tocNode.nextSibling();
 			}
 		}
 		// cache manager




More information about the scribus-commit mailing list