r24065 by jghali - Code style fixes

scribus-commit scribus-commit at lists.scribus.net
Fri Oct 9 16:46:56 UTC 2020


Author: jghali
Date: Fri Oct  9 16:46:56 2020
New Revision: 24065

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

Modified:
    trunk/Scribus/scribus/ui/prefs_guides.cpp
    trunk/Scribus/scribus/ui/scrspinbox.cpp

Modified: trunk/Scribus/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24065&path=/trunk/Scribus/scribus/ui/prefs_guides.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guides.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_guides.cpp	Fri Oct  9 16:46:56 2020
@@ -186,22 +186,22 @@
 void Prefs_Guides::saveGuiToPrefs(struct ApplicationPrefs *prefsData) const
 {
 	prefsData->guidesPrefs.renderStackOrder = renderStackOrder;
-	prefsData->guidesPrefs.guideRad=guideSnapDistanceSpinBox->value();
-	prefsData->guidesPrefs.grabRadius=guideGrabRadiusSpinBox->value();
-	prefsData->guidesPrefs.guidesShown=visibilityGuidesCheckBox->isChecked();
-	prefsData->guidesPrefs.marginsShown=visibilityMarginsCheckBox->isChecked();
-	prefsData->guidesPrefs.gridShown=visibilityGridCheckBox->isChecked();
-	prefsData->guidesPrefs.baselineGridShown=visibilityBaselineGridCheckBox->isChecked();
+	prefsData->guidesPrefs.guideRad = guideSnapDistanceSpinBox->value();
+	prefsData->guidesPrefs.grabRadius = guideGrabRadiusSpinBox->value();
+	prefsData->guidesPrefs.guidesShown = visibilityGuidesCheckBox->isChecked();
+	prefsData->guidesPrefs.marginsShown = visibilityMarginsCheckBox->isChecked();
+	prefsData->guidesPrefs.gridShown = visibilityGridCheckBox->isChecked();
+	prefsData->guidesPrefs.baselineGridShown = visibilityBaselineGridCheckBox->isChecked();
 	double unitRatio = unitGetRatioFromIndex(prefsData->docSetupPrefs.docUnitIndex);
-	prefsData->guidesPrefs.majorGridSpacing=majorGridSpacingSpinBox->value() / unitRatio;
-	prefsData->guidesPrefs.minorGridSpacing=minorGridSpacingSpinBox->value() / unitRatio;
-	prefsData->guidesPrefs.valueBaselineGrid=baselineGridSpacingSpinBox->value();
-	prefsData->guidesPrefs.offsetBaselineGrid=baselineGridOffsetSpinBox->value();
-	prefsData->guidesPrefs.guideColor=colorGuides;
-	prefsData->guidesPrefs.marginColor=colorMargin;
-	prefsData->guidesPrefs.majorGridColor=colorMajorGrid;
-	prefsData->guidesPrefs.minorGridColor=colorMinorGrid;
-	prefsData->guidesPrefs.baselineGridColor=colorBaselineGrid;
+	prefsData->guidesPrefs.majorGridSpacing = majorGridSpacingSpinBox->value() / unitRatio;
+	prefsData->guidesPrefs.minorGridSpacing = minorGridSpacingSpinBox->value() / unitRatio;
+	prefsData->guidesPrefs.valueBaselineGrid = baselineGridSpacingSpinBox->value();
+	prefsData->guidesPrefs.offsetBaselineGrid = baselineGridOffsetSpinBox->value();
+	prefsData->guidesPrefs.guideColor = colorGuides;
+	prefsData->guidesPrefs.marginColor = colorMargin;
+	prefsData->guidesPrefs.majorGridColor = colorMajorGrid;
+	prefsData->guidesPrefs.minorGridColor = colorMinorGrid;
+	prefsData->guidesPrefs.baselineGridColor = colorBaselineGrid;
 	prefsData->guidesPrefs.gridType = gridTypeCombo->currentIndex();
 }
 
@@ -268,9 +268,9 @@
 void Prefs_Guides::changeRenderStack()
 {
 	renderStackOrder.clear();
-	for (int a = 0; a < guidePlacementListBox->count(); a++)
-	{
-		renderStackOrder.prepend(guidePlacementListBox->item(a)->data(Qt::UserRole).toInt());
+	for (int i = 0; i < guidePlacementListBox->count(); i++)
+	{
+		renderStackOrder.prepend(guidePlacementListBox->item(i)->data(Qt::UserRole).toInt());
 	}
 	int curr = guidePlacementListBox->currentRow();
 	if (curr == 0)
@@ -296,7 +296,7 @@
 	if (curr == 0)
 		return;
 	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
-	guidePlacementListBox->insertItem(curr-1, it);
+	guidePlacementListBox->insertItem(curr - 1, it);
 	guidePlacementListBox->setCurrentItem(it);
 	changeRenderStack();
 }
@@ -304,10 +304,10 @@
 void Prefs_Guides::moveDown()
 {
 	int curr = guidePlacementListBox->currentRow();
-	if (curr == static_cast<int>(guidePlacementListBox->count())-1)
+	if (curr == static_cast<int>(guidePlacementListBox->count()) - 1)
 		return;
 	QListWidgetItem *it = guidePlacementListBox->takeItem(curr);
-	guidePlacementListBox->insertItem(curr+1, it);
+	guidePlacementListBox->insertItem(curr + 1, it);
 	guidePlacementListBox->setCurrentItem(it);
 	changeRenderStack();
 }

Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24065&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp	(original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp	Fri Oct  9 16:46:56 2020
@@ -94,7 +94,7 @@
 
 void ScrSpinBox::setParameters( int s )
 {
-	if (s>=0 && s <=unitGetMaxIndex())
+	if (s >= 0 && s <= unitGetMaxIndex())
 		setDecimals(static_cast<int>(pow(10.0, s)));
 	else
 		setDecimals(100);




More information about the scribus-commit mailing list